Exception uploading from read-only media

Upload core product.
ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Exception uploading from read-only media

Post by ajassal »

When we upload files from a read-only media we are getting an IO exception. This could be because the applet is trying to write chunks / zip file locally directly onto the read-only media.

Any work-arounds for this? We could possibly specify the default java tmp folder for this purpose?


Here is the exception:

java.io.FileNotFoundException: E:\VIDEO_TS\VIDEO_TS.VOB.zip (Access is
denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at jfileupload.transfer.client.B.E.A(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.I(Unknown
Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.C(Unknown
Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
Jun 11, 2008 9:12:31 AM
jfileupload.transfer.client.http.HTTPUploadTransfer J
INFO: Split triggered
Jun 11, 2008 9:12:31 AM
jfileupload.transfer.client.http.HTTPUploadTransfer J
INFO: Split started 1/11
Jun 11, 2008 9:12:31 AM
jfileupload.transfer.client.http.HTTPUploadTransfer J
SEVERE: java.io.FileNotFoundException: E:\VIDEO_TS\VIDEO_TS.VOB.1
(Access is denied)
Jun 11, 2008 9:12:31 AM
jfileupload.transfer.client.http.HTTPUploadTransfer run
INFO: Upload failed

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

Re: Exception uploading from read-only media

Post by support »

Try:
<PARAM NAME="chunkmode" VALUE="onfly">

It won't generate chunks on disk and it will be quite faster.

Does it help ?

ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Re: Exception uploading from read-only media

Post by ajassal »

Well the documentation of that parameter says "...This parameter isn't allowed when resume support is enabled. "

We do need resume support as well as compression.

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

Re: Exception uploading from read-only media

Post by support »

I see. A workaround could be to setup tmpfolder parameter. It should generate the files in the local tmp dir. Try: <PARAM NAME="tmpfolder" VALUE="javatmpdir">

Does it help ?

ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Re: Exception uploading from read-only media

Post by ajassal »

So this parameter does modify the location where the .zip compressed file is created.

But there is a new issue. For some files I am getting a NPE in the console and the applet hangs.

Exception in thread "Thread-36" java.lang.StringIndexOutOfBoundsException: String index out of range: -9
at java.lang.String.substring(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.C(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.E(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.D(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.I(Unknown Source)
at jfileupload.transfer.client.http.HTTPUploadTransfer.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Not sure what the pattern is. Maybe files that are in the root folder are ok.

I also noticed that the file name coming to the server now has the temp folder name in it. For example, C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\excel_save.txt.zip. Can we avoid that?

Amrit

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

Re: Exception uploading from read-only media

Post by support »

Are you using the overall progress bar ?

ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Re: Exception uploading from read-only media

Post by ajassal »

Well the only progress bar related parameter I see that we are using is "resetprogressbar". Which is set to true.

Is that what you meant?

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

Re: Exception uploading from read-only media

Post by support »

No, JFileUpload can provide two progress bars. One for individual upload (each file one by one) and another for all files (it's the overall progressbar). Overall progress bar is setup in i18n.properties.

Also, you could post here you JavaScript with applet parameters declaration ?

ajassal
Posts: 11
Joined: Sun May 11, 2008 4:27 pm

Re: Exception uploading from read-only media

Post by ajassal »

Here is the applet tag:

<APPLET CODE="jfileupload.upload.client.MApplet.class" JAVA_CODEBASE="./" ARCHIVE="/jfileupload/lib/jfileupload.jar,/jfileupload/lib/httpimpl.jar,/jfileupload/lib/chttpclient.jar,/jfileupload/lib/clogging
.jar,/jfileupload/lib/batchui.jar,/jfileupload/lib/weakssl.jar" WIDTH="430" HEIGHT="300" NAME="fileupload"><PARAM NAME=CODE VALUE="jfileupload.upload.client.MApplet.class">
<PARAM NAME=CODEBASE VALUE="./">
<PARAM NAME=CACHE_ARCHIVE VALUE="/jfileupload/lib/jfileupload.jar,/jfileupload/lib/httpimpl.jar,/jfileupload/lib/chttpclient.jar,/jfileupload/lib/clogging.jar,/jfileupload/lib/batchui.jar,/jfileupload/lib/weakssl.jar">
<PARAM NAME="CACHE_VERSION" VALUE="_@jappletVersion_@,_@jappletVersion_@,_@jappletVersion_@,_@jappletVersion_@,_@jappletVersion_@,_@jappletVersion_@">
<PARAM NAME=NAME VALUE="fileupload">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.4">
<PARAM NAME="scriptable" VALUE="true">
<PARAM NAME="url" VALUE="' + _postUrlProtocol + '://' + _postUrl + '/multi-file-upload">
<PARAM NAME="paramfile" VALUE="uploadfile">
<PARAM NAME="param1" VALUE="todo">
<PARAM NAME="value1" VALUE="upload">
<PARAM NAME="param2" VALUE="relativefilename">
<PARAM NAME="value2" VALUE="true">
<PARAM NAME="param3" VALUE="cookiename">
<PARAM NAME="value3" VALUE="JSESSIONID">
<PARAM NAME="param4" VALUE="cookievalue">
<PARAM NAME="value4" VALUE="' + getCookie('JSESSIONID') + '">
<PARAM NAME="param5" VALUE="egnyte.multiFile.targetFolder">
<PARAM NAME="value5" VALUE="' + _targetFolder + '">
<PARAM NAME="param6" VALUE="selectedfullfilename">
<PARAM NAME="value6" VALUE="true">
<PARAM NAME="param7" VALUE="weakssl">
<PARAM NAME="value7" VALUE="true">
<PARAM NAME="param8" VALUE="notifyrelativefilename">
<PARAM NAME="value8" VALUE="true">
<PARAM NAME="forward" VALUE="/jfileupload/multi_file_upload_commit.jsp?egnyte.multiFile.targetFolder=' + encodeURIComponent(_targetFolder) + '">
<PARAM NAME="folderdepth" VALUE="-1">
<PARAM NAME="resume" VALUE="crc">
<PARAM NAME="chunksize" VALUE="2097152">
<PARAM NAME="retry" VALUE="3">
<PARAM NAME="ziponfly" VALUE="zip">
<PARAM NAME="zipignorelist" VALUE="*.zip,*.gz,*.Z,*.avi,*.wmv,*.mpg,*.mpeg,*.wav,*.au,*.bmp,*.jpg,*.jpeg,*.gif,*.mp3,*.jar,*.exe,*.msi">
<PARAM NAME="transferuiresources" VALUE="/jfileupload/i18n_pane">
<PARAM NAME="resetprogressbar" VALUE="true">
<PARAM NAME="mode" VALUE="http">
<PARAM NAME="regfile" VALUE="jfileupload/license.oxw">
<PARAM NAME="encoding" VALUE="UTF-8">
<PARAM NAME="transferui" VALUE="jfileupload.transfer.client.edesign.BatchTransferUI">
<PARAM NAME="transferuiparam1" VALUE="regfile">
<PARAM NAME="transferuivalue1" VALUE="/jfileupload/license.oxw">
<PARAM NAME="tmpfolder" VALUE="javatmpdir">
<PARAM NAME="resources" VALUE="/jfileupload/i18n_bar">
</OBJECT>
</NOEMBED></EMBED>
</APPLET>

Here is the fragment from i18n_bar.properties for the progress bar.

# Progress bar panel
progress.button.cancel=Cancel
#progress.button.cancel.color.background=EEEEEE
#progress.button.cancel.color.foreground=000000
#progress.button.cancel.disabled.color=000099
#progress.button.cancel.font.size.factor=2
#progress.button.cancel.font.style=bold
progress.button.select=Select file(s)
#progress.button.select.color.background=EEEEFF
#progress.button.select.color.foreground=000033
#progress.button.select.disabled.color=000099
#progress.button.select.font.size.factor=2
#progress.button.select.font.style=bold
progress.button.spacing.x=5
progress.button.spacing.y=2
progress.button.spacing.color=FFFFFF
#progress.bar.color.background=DDDDFF
#progress.bar.color.foreground=5577FF
#progress.bar.color.selection.foreground=0000FF
#progress.bar.color.selection.background=0088AA
#progress.bar.font.size.factor=2
#progress.bar.font.style=bold
#progress.bar.upload.starting.label=Upload starting ...
progress.bar.upload.label=Uploading {0}% ({1}) [{2} files left]
progress.bar.upload.completing.label=Completing upload ...
#progress.bar.upload.completing.color=55AAFF
progress.bar.upload.completed.label=Uploaded
progress.bar.upload.done.label=Upload completed ({0} files)
progress.bar.upload.failed.label=Upload failed : {0}
progress.bar.upload.cancelled.label=Upload cancelled
progress.bar.upload.checksum.started.label=Computing {0} checksum ...
progress.bar.upload.checksum.completed.label=Checksum computed
progress.bar.upload.compress.started=Compressing : {0} ...
progress.bar.upload.compress.completed=Compression completed
progress.bar.upload.compress.failed=Compression failed : {0}
progress.bar.upload.filter.started=Filtering to {0} ...
progress.bar.upload.filter.completed=Filtering completed
progress.bar.upload.filter.failed=Filtering failed {0}
#progress.bar.upload.option=chunkratio

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

Re: Exception uploading from read-only media

Post by support »

Ok, I will try to reproduce the problem. Another question: Does it occur when you try to upload a file which is not on a read-only device ?

Post Reply