• Hi,

    Since installing 5.2 i have trouble uploading files larger than 2mo, although this has been working perfectly on my site for many years.
    The exact error in the console is:
    “TypeError: Cannot read property ‘replace’ of null at uploadSuccess”
    It looks like the ID of the uploaded file is not returned and the rest of the upload process crashes.

    I already tried 100 things like upgrading php version, increasing the memory, and everything suggested here: https://www.wpoven.com/blog/http-error-in-wordpress-when-uploading-images-and-its-fix/
    It just doesn’t work.

    Any idea ?
    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • HTTP error is different from what you’re experiencing. I think you may have a plugin conflict. Have you tried disabling plugins to see if any one of them is causing this issue?

    Thread Starter nostudiofr

    (@nostudiofr)

    Yes i tried disabling everything, i tried activating the default theme, nothing worked…

    It’s possible an update to 5.2 corrupted some files. What you would need to do is manually replace core WP files via FTP or cPanel File Manager.

    You want to make sure to make a backup before making any changes.

    Thread Starter nostudiofr

    (@nostudiofr)

    Good idea, thanks.
    I tried, but it didn’t work, still the same error.

    The async-upload.php ajax call returns with a 200 status, but it does not return the ID of the new media… which cause the javascript to crash.

    Note that for a smaller PDF file, it works.
    To me it looks like a server problem with the uploaded file, but i just cannot figure out what is going on, and how to solve it…

    Create a file called info.php in the public_html directory. Add this inside:
    <?php phpinfo(); ?>

    Save, then load the file in the browser. It should display your PHP information.

    Check these 2 values:

    • upload_max_filesize
    • post_max_size

    If they are 2 MB, you should increase these values to something larger. You’ll need to check with your host on how to customize PHP settings.

    Thread Starter nostudiofr

    (@nostudiofr)

    Both are 128M.
    Any idea of where i should look to debug what crashes in the upload process ?

    Your PHP error log should have some errors if relevant. cPanel hosting usually places it inside public_html called php_errors.

    You should also enable WordPress debugging to see if debug.log has any relevant errors. Add this to your wp-config.php, replacing existing define( 'WP_DEBUG', false );

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );
    
    // Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
    define( 'SCRIPT_DEBUG', true );

    Which version of PHP do you have?

    • This reply was modified 5 years, 6 months ago by ProjectArmy.
    Thread Starter nostudiofr

    (@nostudiofr)

    My PHP version is 7.3.
    I tried all the things you suggested, and still no result, and no debug file generated.
    I tried to install a brand new and empty version of WordPress in a subdirectory, and i still have the same problem !
    So i guess it must be a server problem, and i wrote a request to the support of my web hosting company, but still no answer from them…
    Looks like i’m stuck… ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Upload error’ is closed to new replies.