Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert Runge 7 posts 27 karma points
    May 06, 2015 @ 15:57
    Robert Runge
    0

    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

    May 06, 2015 @ 15:59

    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?

  • Robert Runge 7 posts 27 karma points
    May 06, 2015 @ 16:17
    Robert Runge
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 06, 2015 @ 16:24
    Jan Skovgaard
    0

    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

    May 06, 2015 @ 16:24

    Ok thanks for the files will give it a try

  • Robert Runge 7 posts 27 karma points
    May 06, 2015 @ 16:30
    Robert Runge
    0

    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

    May 06, 2015 @ 16:32

    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?

  • Robert Runge 7 posts 27 karma points
    May 06, 2015 @ 17:44
    Robert Runge
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 06, 2015 @ 19:32
    Jan Skovgaard
    0

    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

  • Robert Runge 7 posts 27 karma points
    May 07, 2015 @ 09:01
    Robert Runge
    0

    @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

    May 07, 2015 @ 09:50

    @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

    May 07, 2015 @ 09:55

    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

    May 07, 2015 @ 11:23

    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

  • Robert Runge 7 posts 27 karma points
    May 07, 2015 @ 13:15
    Robert Runge
    0

    @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

    May 07, 2015 @ 13:16

    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

    May 07, 2015 @ 13:37

    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

    May 07, 2015 @ 13:40

    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

    May 07, 2015 @ 13:44

    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

  • Robert Runge 7 posts 27 karma points
    May 07, 2015 @ 16:14
    Robert Runge
    0

    I agree - bad file.

    Thanks for all the help - Let's close this one.

    Best Regards,
    Robert

Please Sign in or register to post replies

Write your reply to:

Draft