Overwrite

Files and folders downloader add-on with resume support.

Overwrite

Postby vlad » Thu Sep 20, 2012 6:00 pm

I am using the applet to download folders, recursively, via HTTP. I have the following parameters set:

<PARAM NAME="item1" VALUE="Files">
<PARAM NAME="param2" VALUE="relativefilename">
<PARAM NAME="value2" VALUE="true">
<PARAM NAME="overwrite" VALUE="false">
<PARAM NAME="resume" VALUE="true">
<PARAM NAME="folderdepth" VALUE="-1">
<PARAM NAME="authentication" VALUE="auto">
<PARAM NAME="encoding" VALUE="UTF-8">

My folder "Files" has one single file. If I am downloading the folder multiple times, choosing the same location, the applet is overwriting my file every time and it the local file is only downloaded partially, it doesn't ask to resume. I never get the prompt I see in the screenshot on this website.

Thanks,

Vlad
vlad
 
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Overwrite

Postby support » Fri Sep 21, 2012 6:37 am

Important parameters to get pop-up are:
<PARAM NAME="overwrite" VALUE="false">
<PARAM NAME="resume" VALUE="true">
But you already have them.

What about in18_pane.properties, does it load?
Do you have:
<PARAM NAME="transferuiresources" VALUE="i18n_pane">
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Overwrite

Postby vlad » Fri Sep 21, 2012 8:40 am

Yes, I have also the following two:

<PARAM NAME="resources" VALUE="i18n_bar">
<PARAM NAME="transferuiresources" VALUE="i18n_pane">

I made no changes to the two configuration files.
Just can't make the applet ask me about overwriting or resuming.
vlad
 
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Overwrite

Postby vlad » Fri Sep 21, 2012 2:57 pm

Another question. Can I merge "i18n_bar.properties" and "i18n_pane.properties" into a single file? I don't want to have the applet download two separate files for the same purpose.
vlad
 
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Overwrite

Postby support » Sat Sep 22, 2012 8:43 am

No, you cannot merge. You must have 2 files.
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm

Re: Overwrite

Postby vlad » Sat Sep 22, 2012 9:51 am

I have merged the contents of the files set the same filename for both resources:

<PARAM NAME="resources" VALUE="java_download_locale">
<PARAM NAME="transferuiresources" VALUE="java_download_locale">
<PARAM NAME="localeresources" VALUE="false">
<PARAM NAME="localeresourcesextension" VALUE=".php">

It works, but of course the applet is making two separate requests. At least some server-side HTTP caching will work after the first request to speed it up. The thing is, the file "i18n_pane.properties", if you remove the commented lines, it is very small and it doesn't really deserve a file of its own.

Anyway, this is not very important, more of a cosmetic thing. The overwrite problem is very important and still can't make it work. No idea what to try next.
vlad
 
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Overwrite

Postby support » Tue Sep 25, 2012 7:59 pm

So if your .properties are OK, then it's a problem with the server-side script (i.e. process.php + explorer.php). If you look at the online demo, does it prompt for resume/overwrite?
http://www.jfileupload.com/products/dem ... nload.html

Here is how it works basically:
- If the file you want to download does not already exist on local folder, applet download files directly.
- If the file you want to download does already exist on local folder, then applet sends an HTTP HEAD request to know remote file size. Then depending on response that includes filesize applet knows if it should prompt either resume or overwrite.

If you're using MD5 for resume, then it will compare local/remote MD5 too.

Here are the HTTP traces you can get by enabling:
<PARAM NAME="verbosemode" VALUE="debug">

[DEBUG] header - >> "HEAD /products/demo/process.php HTTP/1.1[\r][\n]"
[DEBUG] HttpMethodBase - Adding Host request header
[DEBUG] header - >> "Range: bytes=0-156931[\r][\n]"
[DEBUG] header - >> "filename: /samplefile200901.jpg[\r][\n]"
[DEBUG] header - >> "checksum: md5[\r][\n]"
[DEBUG] header - >> "relativefilename: /samplefile200901.jpg[\r][\n]"
[DEBUG] header - >> "User-Agent: JFileUpload[\r][\n]"
[DEBUG] header - >> "Host: www.jfileupload.com[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "Date: Tue, 25 Sep 2012 19:43:53 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache[\r][\n]"
[DEBUG] header - << "X-Powered-By: PHP/5.2.17[\r][\n]"
[DEBUG] header - << "Connection: close[\r][\n]"
[DEBUG] header - << "size: 156931[\r][\n]"
[DEBUG] header - << "checksum: 782bea7295d8a477c42a9c2e5bf8b9a0[\r][\n]"
[DEBUG] header - << "Vary: Accept-Encoding,User-Agent[\r][\n]"
[DEBUG] header - << "Content-Type: text/html; charset=UTF-8[\r][\n]"
[DEBUG] header - << "[\r][\n]"
[DEBUG] HttpMethodBase - Should close connection in response to directive: close
[DEBUG] HttpConnection - Connection is locked. Call to releaseConnection() ignored.
[DEBUG] HttpConnection - Releasing connection back to connection manager.
[INFO] G - Head Status code = 200
[DEBUG] HTTPDownloadTransfer - localfolder:C:\Users\Documents
[DEBUG] HTTPDownloadTransfer - account:C:\Users\Documents
[DEBUG] HTTPDownloadTransfer - relativefilename:true
[INFO] HTTPDownloadTransfer - Download (POST) started : /samplefile200901.jpg
[DEBUG] HttpConnection - Open connection to www.jfileupload.com:80
network: Connexion de http://www.jfileupload.com:80/ avec proxy=DIRECT
[DEBUG] header - >> "POST /products/demo/process.php HTTP/1.1[\r][\n]"
[DEBUG] HttpMethodBase - Adding Host request header
[DEBUG] header - >> "filesystem: jfileupload.download.http.HTTPDownloadTransfer[\r][\n]"
[DEBUG] header - >> "localfolder: C:\Users\Documents[\r][\n]"
[DEBUG] header - >> "account: C:\Users\Documents[\r][\n]"
[DEBUG] header - >> "relativefilename: true[\r][\n]"
[DEBUG] header - >> "User-Agent: JFileUpload[\r][\n]"
[DEBUG] header - >> "Host: www.jfileupload.com[\r][\n]"
[DEBUG] header - >> "Content-Length: 41[\r][\n]"
[DEBUG] header - >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
[DEBUG] header - >> "[\r][\n]"
[DEBUG] EntityEnclosingMethod - Request body sent
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
[DEBUG] header - << "Date: Tue, 25 Sep 2012 19:44:01 GMT[\r][\n]"
[DEBUG] header - << "Server: Apache[\r][\n]"
[DEBUG] header - << "X-Powered-By: PHP/5.2.17[\r][\n]"
[DEBUG] header - << "Connection: close[\r][\n]"
[DEBUG] header - << "Content-Length: 156931[\r][\n]"
[DEBUG] header - << "Vary: Accept-Encoding,User-Agent[\r][\n]"
[DEBUG] header - << "Content-Type: text/html; charset=UTF-8[\r][\n]"
[DEBUG] header - << "[\r][\n]"
[INFO] HTTPDownloadTransfer - Status code = 200
[DEBUG] HttpMethodBase - Should close connection in response to directive: close
[DEBUG] HttpConnection - Releasing connection back to connection manager.
[INFO] HTTPDownloadTransfer - Download completed
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm


Return to JFileDownload



cron

Sitemap | Privacy Statement | Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the U.S. and other countries. All other company and/or product names are the property of their respective owners.