• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading file through servlet problem no. 2

 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i manage to upload the file unto the server. but every time i reset the server or clean build or re run the application, the files are deleted on the folder i had created. here is my code



any suggestions?

using netbeans 6.5, Jboss
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use real words when posting to the forums. Abbreviations such as "thru" in place of "through" only serve to make your posts more difficult to read and less likely to generate useful responses. I have corrected your title.

Please read this for more information.

thanks,
bear
JavaRanch sheriff
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are writing the files into the body of the web application. Bad idea. Hugely bad!

Write uploaded files elsewhere on the file system where they are immune from the vagaries of application restarts, reloads and updates.
 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmmm ok, i can put them somewhere, but im thinking how to retrieve those files back so my web app can use it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a servlet that will read the files and stream them as the response.
 
Led Estonilo
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it. ill try that. thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic