Last modified: 2011-05-27 22:31:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31174, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29174 - Upload by URL regression: file size limited by PHP memory limit ($wgAllowCopyUploads)
Upload by URL regression: file size limited by PHP memory limit ($wgAllowCopy...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.20.x
All All
: Unprioritized normal (vote)
: ---
Assigned To: Brion Vibber
:
Depends on:
Blocks: 20512
  Show dependency treegraph
 
Reported: 2011-05-27 21:57 UTC by Brion Vibber
Modified: 2011-05-27 22:31 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2011-05-27 21:57:55 UTC
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.
Comment 1 Brion Vibber 2011-05-27 22:01:00 UTC
Since I'm sitting in front of it, I'll do the fix. :)
Comment 2 Brion Vibber 2011-05-27 22:31:58 UTC
Done on trunk in r89003.

Confirmed can upload the 64mb .ogv file which previously failed: http://prototype.wikimedia.org/tmh/images/b/b2/File-Arborophila_brunneopectus_pair_feeding_-_Kaeng_Krachan.ogv

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links