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.
Version: 1.20.x
Severity: normal