Cancelling...

Upload core product.
import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Cancelling...

Post by import »

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 ?

Thanks for your reply !

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

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.

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

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)

14 déc. 2007 13:00:00 org.apache.commons.httpclient.HttpMethodBase processRequest
INFO: Recoverable exception caught when processing request
INFO: Upload Cancelled

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...

If you've got any clue... I'm quite stuck now.

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

"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");

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

Hi,

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.

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

If you don't find the solution then contact support(at)jfileupload(dot)com they should be able to provide an alternative solution based on 2.0 beta.

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

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 ?)

Thanks

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

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.

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

Those variables are ok.
I've set the timeout param to a large value and it's ok, at least on a regular http transfer.
I'll test tomorrow the https.

We are in a process of consolidating our upload, but I'd like to drop an eye on your solution.
I'll drop you a mail at support.

Thanks for your care !

import
Posts: 169
Joined: Sun Jan 27, 2008 8:10 pm

Re: Cancelling...

Post by import »

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 :

20 déc. 2007 10:39:36 org.apache.commons.httpclient.HttpMethodBase processRequest
INFO: Recoverable exception caught when processing request

Then 2 minutes later, upload finally failed :
INFO: Upload failed

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...

Post Reply