I am required to upload files using my web application. Using a servlet for this. And using Apache Commons - FileUpload (My favourite is the O' Reilly Multipart, but cant use it because of licensing issues).
The file upload works fine as long as i try to upload to directories already present, but if the directories are not present and i try to create the directories, i get an 'Access Denied' Exception.
Here is the code:
and the Exception is:
Yep, i know, not the best of codes, but am concerned with the Exception at the moment.
Should i separate the tasks of making the directories and then writing to them in 2 different servlets? Will that work?? [ October 06, 2005: Message edited by: Neeraj Dheer ]
Joined: Mar 30, 2005
sorry...my mistake...bug in the code...was trying to open a directory with FileOutputStream, not a file...