File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Upload Error

 
vishnu vyasan
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am Trying to upload a file to server using appache commons FileUpload. I am getting this exception.



Here is my Code
Html


JSP


The code is executing fine till the fi.write(fNew) part of the code. Is it not possible to create a file inside the Application server and write the contents to it?

Any help on this would be appreciated.

Best Regards
Vishnu NV
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the "temp" directory exist, and does the user account running the servlet container have access permission to it?

As an aside, it's considered bad design to do stuff like this in a JSP. Much better to do it in a servlet.
 
vishnu vyasan
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for replying.

There was no temp directoy initialy, i wanted it to create it using the code only. Now i have created one, the code executed fine.
So i think your suggession regarding the rights is correct.

Now i am facing another problem, like when the upload path goes a little deep i am getting exception file not found.

Best regards
Vishnu NV
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic