Cancel an upload with chunks filesCancel an upload with chunks filesHi, when I cancel an upload of a chunked file, for example if I cancel on the third of five chunks, upload cancels well, but the two chunks created and uploaded before I hit the cancel button are on my ftp server. I would like when I cancel a file upload, there is not chunks files uploaded on my ftp server, is it possible? I use JFileUpload 2.2 and your php sample. Thanks !
Re: Cancel an upload with chunks filesYou would like to delete the 2 chunks on server, correct ?
I think it should be possible if you're able to detect the connection closing in the FTP script. If you can catch this event then you can check for orphan chunks and delete them. Re: Cancel an upload with chunks files@skum3: You could also use JSAPI addon (http://www.jfileupload.com/products/tools/index.html), to have the JavaScript function "JSTransferCancelled" make a simple request to your server (Ajax or whatever), something like "http://www.yourserver.com/the-upload-sc ... ter_cancel".
@support: Speaking of canceling a chunked upload, there is an annoying behavior that disables the cancel button each time a chunk is uploaded. I'm using the chunk feature seamlessly, with a relatively small chunk size. This makes it difficult for the user to cancel the upload, as the button gets disabled and enabled very fast. You can cancel the upload only by clicking the button repeatedly hoping that you will catch it enabled (it's like the children game where you need to smack a popping animal in the head with a rubber hammer ). Re: Cancel an upload with chunks filesAre you using "chunkmode=onfly" ? It should not create chunk on disk so disable period for "Cancel" button should be 0.1 second so you should be able to cancel the upload (except if your upload is also 0.1 second).
Re: Cancel an upload with chunks filesYes, I'm using the "onfly" "chunkmode" feature, I am not sure where the temporary pieces are stored and I didn't want the users to notice temporary files on their computers.
The "Cancel" button gets difficult to press when using a small chunk size over a fast connection. Re: Cancel an upload with chunks filesWith "onfly" it's in memory, so you will never see temporary files. I understand the issue with small chunks. Let me see how to improve it in 2.3.
Re: Cancel an upload with chunks filesI've just added the following property in i18n.properties of release 2.3:
#progress.button.cancel.enabling.behavior=lazy You will just have to uncomment it and it should work as you need. I'm going to send an email with a testing version. |