Last modified: 2011-05-27 22:31:58 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.
Since I'm sitting in front of it, I'll do the fix. :)
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