Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] Invalid upload. Error Code : 3

  • Resolved h0tw1r3

    (@h0tw1r3)


    Hopefully this helps others who may run into this problem. I see there was a post about this a year ago with no response.

    Problem
    When attempting to upload multiple files using the flash uploader (ie. plupload), after the first file every subsequent file would return the error and fail.

    “Invalid upload. Error Code : 3”

    Observation
    Without going into the nitty-gritty details, essentially the browser is using the same connection (keepalives) for subsequent uploads which causes the files to be rejected (UPLOAD_ERR_PARTIAL).

    Solution
    Implicitly send the ‘Connection: close’ header. Tells the browser not to reuse the connection for the next request (in this case, upload).

    patch
    Essentially, add header('Connection: close'); to nextgen-gallery/admin/upload.php.

    diff --git a/wp-content/plugins/nextgen-gallery/admin/upload.php b/wp-content/plugins/nextgen-gallery/admin/upload.php
    index c8ba083..88edd05 100644
    --- a/wp-content/plugins/nextgen-gallery/admin/upload.php
    +++ b/wp-content/plugins/nextgen-gallery/admin/upload.php
    @@ -23,6 +23,7 @@ unset($current_user);
     require_once(ABSPATH . '/wp-admin/admin.php');
    
     header('Content-Type: text/plain; charset=' . get_option('blog_charset'));
    +header('Connection: close');
    
     //check for correct capability
     if ( !is_user_logged_in() )
Viewing 2 replies - 1 through 2 (of 2 total)
  • JustBlog

    (@justblog)

    Thanks mate! Just got this solved! 😉

    YESSSSSS – thx so much for this fix!

    No idea why this started occurring for us in the first place but adding the line

    header(‘Connection: close’);

    fixed it for us also.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: NextGEN Gallery] Invalid upload. Error Code : 3’ is closed to new replies.