That's strange since we don't do any additional processing just store the file on filesystem, will see if I can reproduce, mind sending a jpg that has the problem?
Does the images have the same DPI or is different? Something in the back of my mind has a blurry memory about seeing a similar issue like this some years ago where it had to do with the DPI...can't quite remember the solution but perhaps it will come back to me if I'm not mixing this up with something else.
What does the file weigh? And are you sure it's possible to upload a file that way? I've never tried doing it using a http path before so don't know if that's possible.
@Jan, yes - it is quite possible (Windows only though), just try it yourself :-)
The file is 78 KB, but once uploaded it is only 25 KB. Maybe it is because the original JPG is corrupted in such a way, that it is missing EOF-mark or something else.
Hmm can't really find more details on it, we are just using the SaveAs Method on the HttpPostedFileBase class, so nothing fancy just standard MVC (no post processing of the image)
Just tried a standard MVC app and the same thing happens...end up with a corrupted file, will see if I can find more details on it but haven't found any so far... is that the only corrupted image you can find or are there more with the same issue?
Corrupted JPGs after file upload
When I upload jpg's via contour forms, the resulting file is corrupted.
Any idea why this is happening?
What I do know:
- PNG, no problem
- PDF, no problem
- JPG, problem
- Fails in both Chrome and FireFox
What am I missing?
/Robert
Comment author was deleted
That's strange since we don't do any additional processing just store the file on filesystem, will see if I can reproduce, mind sending a jpg that has the problem?
Hi again - and thank you for the quick reply
A correction - most JPGs do work. But I do have an example that does not, or at least when I paste the URL directly into the file dialog that pops up.:
- Does not work: http://funny-wall.com/wp-content/uploads/Worlds-Biggest-Burger-590x445.jpg
- Works: http://www.fundraising123.org/files/u16/bigstock-Test-word-on-white-keyboard-27134336.jpg
/Robert
Hi Robert
Does the images have the same DPI or is different? Something in the back of my mind has a blurry memory about seeing a similar issue like this some years ago where it had to do with the DPI...can't quite remember the solution but perhaps it will come back to me if I'm not mixing this up with something else.
/Jan
Comment author was deleted
Ok thanks for the files will give it a try
Just to clarify:
When I download the image http://funny-wall.com/wp-content/uploads/Worlds-Biggest-Burger-590x445.jpg first - and then upload via the my local file system, it works.
BUT - when i paste the the URL directly, it fails. A bit strange.
Comment author was deleted
Which upload control are you using, the default one doesn't allow pasting in urls so you are probably using a third party one...
Mind sharing a screenshot of your upload control?
Not so sure this is a contour-problem after all. It is just the first time I have seen it.
But to show you what I meant, take a look:
https://dl.dropboxusercontent.com/u/14425426/contour-file-upload-fail.mp4
Hi Robert
What does the file weigh? And are you sure it's possible to upload a file that way? I've never tried doing it using a http path before so don't know if that's possible.
/Jan
@Jan
, yes - it is quite possible (Windows only though), just try it yourself :-)The file is 78 KB, but once uploaded it is only 25 KB. Maybe it is because the original JPG is corrupted in such a way, that it is missing
EOF-mark
or something else.Comment author was deleted
@Robers thanks for the additional details, which version of Contour are you running since it looks like it's a pretty old one
Comment author was deleted
Just tested on latest Contour and also get an invalid image, works ok when I first download and then upload the image but not when pasting in the url
Comment author was deleted
Hmm can't really find more details on it, we are just using the SaveAs Method on the HttpPostedFileBase class, so nothing fancy just standard MVC (no post processing of the image)
https://msdn.microsoft.com/en-us/library/system.web.httppostedfilebase.saveas%28v=vs.110%29.aspx
Will check if this also happens in a sample MVC app
@Tim
probably should have mentioned this in the first post.Umbraco v6.1.3 and Umbraco Contour version 3.0.15
Comment author was deleted
Ok thanks for the details, testing in a couple of different version and they all have the issue with that image
Comment author was deleted
Just tried a standard MVC app and the same thing happens...end up with a corrupted file, will see if I can find more details on it but haven't found any so far... is that the only corrupted image you can find or are there more with the same issue?
Comment author was deleted
Trying to open the file in an image editor like http://apps.pixlr.com/editor/ also results in an error so Image must be corrupt...
Comment author was deleted
Even creating a simple html file that tries to output the image isn't working
<html>
<head></head>
<body>
<img src="http://funny-wall.com/wp-content/uploads/Worlds-Biggest-Burger-590x445.jpg" />
</body>
</html>
Maybe the site has some kind of tool in place in order for people not to be able to link directly to images... So I'm afraid we can't do much about it
I agree - bad file.
Thanks for all the help - Let's close this one.
Best Regards,
Robert
is working on a reply...