https://bugzilla.wikimedia.org/show_bug.cgi?id=29174

       Web browser: ---
             Bug #: 29174
           Summary: Upload by URL regression: file size limited by PHP
                    memory limit ($wgAllowCopyUploads)
           Product: MediaWiki
           Version: 1.19-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: Uploading
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


Upload-by-URL originally used CURL directly and I think wrote directly to a
temporary file, making it suitable for files of any size (unless too big for a
32-bit version of CURL to handle!)

Since r65152 it was switched to use the MWHttpRequest class, which buffers file
content into memory.

Uploading a ~64mb webm file while testing TimedMediaHandler, I got this gem:

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to
allocate 66634174 bytes) in /var/www/trunk/includes/upload/UploadFromUrl.php on
line 118, referer: http://stormcloud.local/trunk/index.php/Special:Upload

That's:
  file_put_contents( $this->mTempPath, $req->getContent()

D'oh!

Needs to use read callbacks to save directly to the temporary file. Looks like
this can be done fairly straightforwardly by calling $req->setCallback() and
passing it a method to append a chunk to the temp file.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to