Can anyone tell me that what is the default location of an uploaded file using struts? Further,if I want to create a new directory in the server with the name of the directory same as that of the upoaded file,what should i do?
An uploaded file doesn't have a location. It is not saved to disk. All you have is a filename (no directory info) and an input stream for the file.
If you want to create a file on disk, ie save the uploaded file somewhere, then you use the standard java.io classes like FileOutputStream.
There are a couple of methods in ServletContext that might help - particularly getRealPath(). The getRealPath() method converts a website relative filename into a real location on disk. You normally use that method if you want to save the file somewhere under your web application.
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
Gift giving made easy with the permaculture playing cards