This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes Uploading files to the current directory. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Uploading files to the current directory." Watch "Uploading files to the current directory." New topic
Author

Uploading files to the current directory.

Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
I want to upload some files to the current directory. i.e. the directory in which the jsp's are kept. I am using Orilley file upload jar for it.
Now the problem is that the upload facility takes the absolute directory path for uploading the file and i cannot get the absolute path at the server where i am executing the application.
Now the question is ..is there any way by which i can get the currently executing directory in the JSP or otherwise..
can i upload some file using orilley (or any other facility ) to the current directory.
-Thanks


Kaustubh. Mumbai, India.
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hi kaustubh
have you tried "jspsmartupload"...??
i works quite well for me, i never have to give the absolute path.
hth
MB


Malhar Barai
SOA & Java Book
Jeya Balaji
Ranch Hand

Joined: Jan 02, 2003
Posts: 40
I did the following to get the real path :

Regards
Balaji


Regards,<br />Balaji
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319
This code will also give you the path where the JSp exists.

application.getRealPath("filename.jsp");
sudharsan


Joy is a radiation
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
Thanks a lot for your answers ...
-Kaustubh
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Uploading files to the current directory.
 
Similar Threads
uploading files in JSP
Upload all the files in the directory to server
finding ftp client home directory
How to upload only image file
HttpClient file upload code review