File upload corruption using FTP when moving to another tab

Upload core product.
rob
Posts: 4
Joined: Fri May 29, 2009 2:34 am

File upload corruption using FTP when moving to another tab

Post by rob »

We are implementing the Premium version of jFileUpload for a client, and we seem to have found a bug, but want to verify that it is with Java / JFileUpload and not with our implementation.

We are using JFileUpload connecting to an FTP on the backend. The files that are being uploaded are typically quite large (500MB - 1.5 GB).

The uploader seems to work perfectly if the client drags a file into the uploader and sits and waits until the upload completes fully. However, if the client starts an upload and then switches to another browser tab the file upload corrupts and the end file on the server is a different size than the file on the clients machine.

We can reproduce this every time in FireFox and Safari on Mac and Linux, and the client says it does not have the problem in Chrome. We are guessing it might have something to do with threading since that is a major difference between Chrome and Firefox et al.

Our question is, does this sound correct? Is this a known bug or perhaps something we are doing incorrectly?

Please let me know if more information would help.

Cheers,
rob

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: File upload corruption using FTP when moving to another tab

Post by support »

No, it's the first report about such issue. What kind of corruption do you notice when you make a diff between original and uploaded file ?

rob
Posts: 4
Joined: Fri May 29, 2009 2:34 am

Re: File upload corruption using FTP when moving to another tab

Post by rob »

They are video and audio files (binary) so I can't diff them (that I know of anyway). They are simply different sizes. For example an MP3 on the client system is 7811766 bytes, after a tab switch upload the file is only 7,629 KB on the server.

If there is no tab switch involved, the file is the same size on both systems.

The steps to reproduce are (at least in our instance):

1) Select a somewhat large file. have jfileupload go directly to an ftp server (filezilla in our case). Here are our param settings

<PARAM NAME="overwrite" VALUE="false">
<PARAM NAME="url" VALUE="ftp://[host]">
<PARAM NAME="param1" VALUE="username">
<PARAM NAME="value1" VALUE="....">
<PARAM NAME="param2" VALUE="password">
<PARAM NAME="value2" VALUE=".....">
<PARAM NAME="param4" VALUE="deleteonfail">
<PARAM NAME="value4" VALUE="true">
<PARAM NAME="param5" VALUE="pasv">
<PARAM NAME="value5" VALUE="false">
<PARAM NAME="value5" VALUE="false">
<PARAM NAME="mode" VALUE="ftp">
<PARAM NAME="maxfiles" VALUE="5">
<PARAM NAME="whitelist" VALUE="*.asf,*.wmv,*.wma,*.mov,*.mp4,*.swf,*.fla,*.flv,*.mp3,*.m4v,*.avi,*.dv,*.wav,*.aif,*.aiff,*.mp3,*.pdf">
<PARAM NAME="folderdepth" VALUE="0">
<PARAM NAME="resume" VALUE="true">
<PARAM NAME="overwrite" VALUE="false">
<PARAM NAME="hiddenfile" VALUE="deny">
<PARAM NAME="post" VALUE="http://...">
<PARAM NAME="postparameters" VALUE="extra">
<PARAM NAME="forward" VALUE="http://....">

2) begin upload (either by drag and drop or select files)
3) while it is uploading switch to another tab, and browse around for a bit.
4) return to the uploader tab (should seem to still be working fine)
5) File sizes will be different (and in our case the file is not deleted and causes a "file already exists error" when you try to upload a file of the same name)

Hope that helps / is reproducible on your systems.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: File upload corruption using FTP when moving to another tab

Post by support »

I will try.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: File upload corruption using FTP when moving to another tab

Post by support »

I've made the following test and it works fine for us:
- Client-side: FireFox 3.0.10/JRE1.6.0_11/Windows Vista
- Server-side: Titan FTP server/Windows XP
- File uploaded: 620MB ZIP file.
- Several tabs opened in FireFox while uploading.

Once uploaded, I've used WinZIP to test integrity of ZIP file and everything is OK.

What configuration do you have ?

rob
Posts: 4
Joined: Fri May 29, 2009 2:34 am

Re: File upload corruption using FTP when moving to another tab

Post by rob »

We have windows 2003 server on the server side with filezilla

On the client side we've tried firefox 3 on Linux, Mac and Windows and also with Safari 4 on Mac.

Are you actually switching to those tabs and browsing while the file is uploading?

We also are using the http call back to move the file to a new location when the file upload is complete. Perhaps that is not being called / called at the wrong time when the tabs have been switched and switched back?

I can make a movie showing you the problem happening if you think that might help.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: File upload corruption using FTP when moving to another tab

Post by support »

Could we have a remote desktop session ? If so then drop an email to support(at)jfileupload(dot)com

rob
Posts: 4
Joined: Fri May 29, 2009 2:34 am

Re: File upload corruption using FTP when moving to another tab

Post by rob »

I don't think remote access will be possible :(

Is there anything else I could provide you with that might help? code samples or log output or anything?

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: File upload corruption using FTP when moving to another tab

Post by support »

You can try to enable debug mode and post the traces here.
The debug mode is detailed at:
http://www.jfileupload.com/products/jfi ... oting.html

eakinasila
Posts: 1
Joined: Sat Nov 21, 2009 11:12 am

Re: File upload corruption using FTP when moving to another tab

Post by eakinasila »

How to make a ftp server from my home computer? i've been trying to make a ftp server from my home computer but i cant ever get it online. ive been using serv-u and ws_ftp home. I still cant get it online i can only get to it through my network can some one tell me how to do it right?
_________________
external keyword tool ~ keyworddiscovery.com ~ keycompete.com ~ compete.com ~ webmasterworld.com
Last edited by eakinasila on Mon Nov 30, 2009 5:15 am, edited 1 time in total.

Post Reply