wood burning stoves 2.0*
The moose likes Servlets and the fly likes Exception while uploading a zip file on Linux OS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Exception while uploading a zip file on Linux OS" Watch "Exception while uploading a zip file on Linux OS" New topic

Exception while uploading a zip file on Linux OS

Anutosh Swamy
Ranch Hand

Joined: Sep 20, 2007
Posts: 30

Hi All,

I am getting an exception of

java.io.FileOutputStream.writeBytes(Native Method)

when I try uploading a ZIP file through my application running on Linux OS but the same is running fine on Windows OS (without any exception and uploading perfectly) kindly let me know where the code is wrong or I need to make some changes accordingly while making this run perfectly on Linux OS

Here's my Servlet code for uploading the Zip file:



Thank you in Advance

K. Anutosh<br /> <br />SCJP 1.4<br />SCWCD 1.4<br />OCA (Paper I)
Nitin Pathak
Ranch Hand

Joined: Sep 25, 2006
Posts: 70
There seems to be the problem with the length argument (endPos - startPos) of write(). As the exception clearly suggests, the code is trying to access the memory location outside the already-rigidly-assigned space.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Oh no, not again that roseindia.net ripoff.

Please read my answer in this topic: http://www.coderanch.com/t/414105/Servlets/java/Upload-Download-File
subject: Exception while uploading a zip file on Linux OS
Similar Threads
Upload Download File
moving files over the network
Uploading file path in properties file
Large File Size Upload Problem
JSP Page For Uploading a File to Destination Folder