• Resolved jzilberberg

    (@jzilberberg)


    When I upload a jpg file that has anything other than 100 quality, via the add media screen, using either the multi-file uploader or the browser uploader, the image file uploads, the file crunching happens, and all files (original and smaller sizes) end up on the server, but the main file is not accessible in any form (to view via the web, or download and open in an editor), but the crunched files are good. This issue is only with jpgs and not png nor gifs as the quality can’t be adjusted as it can with a jpg. When the jpg quality is 100, the files upload as they should and there is no issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Looks like an issue with one of your plugins. Are you using any plugins like WP Smust it for crunching of any sorts?

    Try deactivating all plugins. If that resolves the issue, reactivate each one individually until you find the cause.

    If that does not resolve the issue, try switching to the default theme for your version of WordPress to rule-out a theme-specific issue (theme functions can interfere like plugins).

    Thread Starter jzilberberg

    (@jzilberberg)

    Thanks for the reply!

    I disabled all plugins and that did not resolve the issue. I switched to a default theme and that did not resolve the issue. I installed a fresh instance of WP and the same issue is happening. This was v4.4. So I installed v4.4.1 to make sure there was not an issue with the version. Same problem. And what I have discovered now is that all uploads, images of any quality and any type, not just jpg, and documents all upload, but the file is corrupt and unusable (crunched image file versions are fine). So, not sure what has happened, but seems it is some issue with file uploading to my server overall with WP. FTP files are fine.

    Any ideas what this could possibly be?

    Thread Starter jzilberberg

    (@jzilberberg)

    FYI, the freshly installed versions have no plugins installed and are using the default theme. Literally “out-of-the-box” install with no modifications.

    Thread Starter jzilberberg

    (@jzilberberg)

    Found this issue. There was a misplaced web.config file on the WP root that was not supposed to be there.

    Thanks!

    Thread Starter jzilberberg

    (@jzilberberg)

    FYI, on further investigation, the real issue was not that the file being uploaded was being corrupted. It was that there was a rewrite rule in place that was causing the file to be not found and a 500 error to be thrown. Finding the bad web.config file sort of solved the issue as it had the rewrite rule in it. Deleting it caused the image to be viewable, but caused the page permalink navigation to be broken. Putting the rule back in place in the root directory web.config file fixed the navigation issue, but broke the image path again. So, the fix was to put another rule in place to ignore the uploads directory for the rewrite rule. See the bold potion in the code below:

    <rewrite>
    <rules>

    <rule name=”block” stopProcessing=”true”>
    <match url=”^wp/wp-content/uploads” />
    <action type=”None” />
    </rule>

    <rule name=”wordpress” patternSyntax=”Wildcard”>
    <match url=”*” ignoreCase=”false” />
    <conditions>
    <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true”/>
    <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true”/>
    </conditions>
    <action type=”Rewrite” url=”wp/index.php” appendQueryString=”true” />
    </rule>

    </rules>
    </rewrite>

    Ahmad Awais

    (@mrahmadawais)

    Glad you figured it out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Media upload issue’ is closed to new replies.