Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: File path passed as parameter

Reply
Thread Tools

Re: File path passed as parameter

 
 
Chris Riesbeck
Guest
Posts: n/a
 
      08-15-2003
In article <(E-Mail Removed)>,
Archaeopteryx <(E-Mail Removed)> wrote:

>
>How can I have the user press a button in order to select a directory
>on its local file system and invoking the servlet passing the
>directory's complete path as parameter.
>
>I thought that I could easily solve the problem with something like:
>
><FORM ACTION="/photoalbum/ImageList" METHOD=GET>
>Image folder: <INPUT NAME="imagefolder" TYPE="file">
><INPUT TYPE="submit" VALUE="Send File">
></FORM>
>
>but this does not work well because:
>1) you cannot select directories, only regular files


You're stuck on that part but can't your servlet deduce the directory
if the user selects a file in it?

>2) only the file name and not the complete path is passed in the
>"imagefolder" parameter.


Use Javascript to get the full path first and stuff
it in a hidden form field, e.g., add

<input type="hidden" name="savedpath">
....
<input type="submit" value="Send File"
onclick="this.form.savedpath.value=this.form.image folder.value">
 
Reply With Quote
 
 
 
 
Archaeopteryx
Guest
Posts: n/a
 
      08-15-2003
On Fri, 15 Aug 2003 13:15:33 -0500, Chris Riesbeck <(E-Mail Removed)> wrote:
> In article <(E-Mail Removed)>,
> Archaeopteryx <(E-Mail Removed)> wrote:
>
>>


> You're stuck on that part but can't your servlet deduce the directory
> if the user selects a file in it?


Yes Chris. It seemed to odd to me at first glance but I understand that
this is probably the only way.

> Use Javascript to get the full path first and stuff
> it in a hidden form field, e.g., add
>
><input type="hidden" name="savedpath">
> ...
><input type="submit" value="Send File"
> onclick="this.form.savedpath.value=this.form.image folder.value">


This is actually worth a try.
Thanks.

Bye



--
A.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying a file from path P1 to path P2 on a *remote* machine... varlagas@yahoo.com Java 1 07-13-2006 06:27 PM
Command line options: using an [option: parameter] without a parameter passed to it soren625 Perl Misc 10 12-28-2005 09:26 PM
Various path/path/files.asp all #include this 1 file \A_Michigan_User\ ASP General 1 07-10-2005 01:55 PM
Just to share my happyness: Passed today 70-290! First try...and passed ;) Hugo Sousa MCSE 12 04-02-2005 12:16 AM
Re: File path passed as parameter Neomorph Java 2 08-16-2003 09:29 PM



Advertisments