Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes File Upload Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "File Upload Error" Watch "File Upload Error" New topic
Author

File Upload Error

vishnu vyasan
Ranch Hand

Joined: May 27, 2008
Posts: 39
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
Marshal

Joined: Mar 22, 2005
Posts: 41184
    
  45
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.


Ping & DNS - my free Android networking tools app
vishnu vyasan
Ranch Hand

Joined: May 27, 2008
Posts: 39
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
 
jQuery in Action, 2nd edition
 
subject: File Upload Error
 
Similar Threads
Error Handling
struts form submiision with hashmaps
Onsubmit error
OAS error while login to application
problem in JSTL connection