• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

Exception while uploading a zip file on Linux OS

Ranch Hand
Posts: 30
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh no, not again that roseindia.net ripoff.

Please read my answer in this topic: https://coderanch.com/t/414105/Servlets/java/Upload-Download-File
Space seems cool in the movies, but once you get out there, it is super boring. Now for a fascinating tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic