Is it possible in PHP to configure it to somehow not save files to disk at all? As a matter of fact, the best thing would be to get the script going before even reading the entire POST body. (Keeping my hopes high ;))
This is not what he means: He wants file uploads to work without temporary files.
Pekka
2010-10-27 09:21:30
it is even worse. he wants to directly catch the upload stream without buffering it into the tempfile. would be pretty nice for verry big fileuploads.
ITroubs
2010-10-27 09:24:11
A:
take a look to that similar question here:
http://stackoverflow.com/questions/2693529/read-file-as-its-being-uploaded
ITroubs
2010-10-27 09:23:02
A:
PHP needs a place to temporarily store the files content for you to be able to interact with it through PHP - although, you don't have to do anything else other then access the temporary file to get the data:
$content = file_get_contents($_FILES["user_file"]["tmp_name"]);
From here on you can manipulate with the files content without having to move the uploaded file to another location before accessing it.
Repox
2010-10-27 09:26:48
A:
You can use HTTP PUT
requests to directly upload a file. PHP will not handle the upload directly (e.g. set it up in $_FILES). Instead, you have to read the raw bytes from the php://input
pseudo-url and from there can do whatever you want.
There's some details and examples here.
Marc B
2010-10-27 17:05:16