WordPress.org

Ready to get started?Download WordPress

Forums

Enable Media Replace
no error message displayed on failed upload (1 post)

  1. hotzeplotz
    Member
    Posted 1 year ago #

    hi,
    we had been having some issues uploading replacement media and upon investigation this turned out to be because of PHP size upload limits set too low in our PHP configuration. The issue is now solved by enabling higher limits, however it was very frustrating for our users to see this plugin silently failing (the only trace of the problem was in the web server's error logs).

    would it be possible to *at least* incorporate the patch at the end of this message in the next version of the plugin so that users are at least informed that something went wrong and can report this to the WordPress admin rather than being left with no clues that an error actually happened? ideally it would be very useful to use wp_die to display the full error message from PHP, but on a quick test this doesn't seem to be available in $_FILES['userfile']['error'] in my test install (the whole $_FILES array is actually empty in my test install when an upload fails because of upload size limits having been exceeded).

    thank you
    andrea

    Index: trunk/upload.php
    ===================================================================
    --- trunk/upload.php    (revision 619372)
    +++ trunk/upload.php    (working copy)
    @@ -147,7 +147,7 @@
     } else {
            //TODO Better error handling when no file is selected.
            //For now just go back to media management
    -       $returnurl = get_bloginfo("wpurl") . "/wp-admin/upload.php";
    +       $returnurl = get_bloginfo("wpurl") . "/wp-admin/upload.php?message=3";
     }
    
     if (FORCE_SSL_ADMIN) {
    @@ -156,4 +156,4 @@
    
     //save redirection
     wp_redirect($returnurl);
    -?>
    \ No newline at end of file
    +?>

    http://wordpress.org/extend/plugins/enable-media-replace/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags