Hi,
I'm facing a difficulty : when cancelling an upload, the "Cancel" button is disabled, but the upload is not cancelled at all.
On a single file upload, the upload continues to the end and even post and forward directives are done.
On a chunked file upload, the cancelled chunk is still uploaded and the following chunks are uploaded.
In both cases, the overall percent exceed 100%.
How does the cancelling work ?
Is there parameters or a combination of parameters that could lead to such a behavior ?
Is there because I'm (still) using the demo ?
Yes, known problem with custom HTTP upload script. Are you using your own HTTP upload script ? You have to set "Connection: close" header in each HTTP response send back from this script otherwise the applet will try to restart the upload even if cancelled. You have sample in add-ons section for PHP, JSP, ASP ...
Note: We plan to improve this behavior in 2.0 and add an option to commit cancel even if "Connection: Close" is not set.
Yes we are using our own framework, and it's pretty difficult to know if the Connection:close is well received by the server...
Our framework is written in PHP5 and runs on Apache2.
When hitting the cancel button, I've got the following lines in my Java console (turned in verbose mode)
But still, the current upload continues as if nothing happened.
Every request from JFileUpload (HEAD) returns a 200 http code (OK).
Perhaps there is something wrong with this...
"Connection:close" is not received by the server. It must be set by the server. It's in the PHP script setup in your "url" parameter. In PHP you can do it with: header("Connection: close");
This is exactly what we've done.
But since the page sending this header is launched inside our homemade framework, maybe there is a side effect when sending this header.
I'll do some test to bypass our framework (it features buffered output to the browser).
I'll keep you informed.
Ok, thank you for your reply.
It seems that it is working well now on our remote servers (not locally).
I still have questions :
I'm making large uploads (>1Gb) and I'm always having "Broken pipe" or "Socket write error" messages. Do you know what they mean ? I can give you further details if you want...
Shall I increase the "timeout" parameter ? (what's the default value btw ?)
For large upload issue I suspect the PHP configuration file. Check the following variables in your php.ini:
file_uploads
upload_max_filesize
post_max_size
max_execution_time
memory_limit
BTW: We have something working for your cancel issue.
This morning I started an upload using HTTPS (+WeakSSL) : the file is 2Gb and thus, it's been splitted in 512Mb chunks.
When uploading the first chunk, everything went right until I suddenly get this in the Java console at about 13% upload :
We've done a lot of tests and everytime it fails at the same point : after 20min of upload whatever the bandwidth. We are thinking of something like a certificate expiry or something.
Everything is right on a "regular" http website.
If you've got any clue...