tags:

views:

183

answers:

1

Am doing project in j2ee.I use Browse button. I need to fetch images/files from a folder inside my project folder, everytime.I wish to set my project's folder name as a default location for my browse button.How to do that?

am using tis following code in a jsp page:

and calling the value in servlet :

String image= (String) request.getParameter("img");

while browsing ,the whole path is getting displayed but only the name of the image is passing as value in the sevlet.How to get the entire path? or how to set my project folder as default location while browsing?

+1  A: 

If this is rendering a standard

<input type="file".../>

Then you have no control over the default directory.

Using flash gains you a bit more control (filetype preset, single/multiple file selection etc.)

I'm not sure if Java Applets have more access/options, hopefully someone can advise.

PS. for the standard input tag, the browser will remember the last location you used, so you only need to navigate once, if you are uploading several files from the same directory.

scunliffe