Marco van Rooij
|First I want to say that I really like this class. Very useful.|
I want to upload a file with POST to a particular webpage.
With small files it works fine, but with larger files it gives me:
S HTTP/1.1 413 Request Entity Too Large
I found out that the file should be uploaded 'chunked' but is it possible to do that with this class?
|2011-09-21 05:28:35 - In reply to message 1 from Marco van Rooij|
|It seems you are exceeding the upload file limit.|
I never heard of chunked file uploads until now. Which Web server supports such kind of uploads?
Marco van Rooij
|2011-09-21 06:43:23 - In reply to message 2 from Manuel Lemos|
I already asked the admin to increase the UploadReadAheadSize setting but I don't think they are going to do that.
|2011-09-21 07:20:26 - In reply to message 3 from Marco van Rooij|
|OK, but is there any browser that supports those chunked file uploads?|
I also have not found any RFC that define how such chunked file uploads work. Do you have any idea?
Would you control to scripts that could run on a IIS server to test eventual support to chunked file uploads in HTTP class?
|2012-04-19 13:01:06 - In reply to message 4 from Manuel Lemos|
I tried to use PHP HTTP class to send files to another server (server B). Everything works if the file is located on server A and is a path to this file.
My questions is:
It is possible directly upload the files from multipart form to another server (server B)?
|2012-04-20 05:47:51 - In reply to message 5 from Piotr|
|Well it will work if you give it the correct path of the uploaded files in disk.|
|2012-04-23 08:16:53 - In reply to message 6 from Manuel Lemos|
|I need to prepare a script that runs on server A to save the POST data. The other hand, saves files to the server B. I do not want first to write files on the server A and later copied to B.|
You think that's possible?
Can you give an example how to do it? How to specify the path to the uploaded file?
$arguments["RequestMethod"]="POST"; //<-- it WORK and variables are sending
Similarly, I try to file but it does not work. I give error 'it was not specified the file part name'
$arguments["PostFiles"] = $_FILES;
How to specify the path to the file transfer that is in the tmp folder?
When I submit form (server A) file is writing in tmp on server A or B?
|2012-04-26 08:48:05 - In reply to message 7 from Piotr|
|I am not sure what you mean, but when PHP handles uploaded files it necessarily creates temporary files. If you want to re-upload those files to another server, you can use the path of those temporary files.|
The PostFiles argument is an associative array of files to upload but it is not the same as $_FILES. You need to map the file names from $_FILES the structure that PostFiles should have. Take a look at the test_http_post.php script to see how you should do it.