Link to home
Start Free TrialLog in
Avatar of PvBredow
PvBredow

asked on

Use Windows FileOpen dialogue in ASP (preferably with VbScript)

I need to have a page (.ASP) that allows the user to use the standard Windows dialogue to select one or more files from their drives.

I have seen snippets of code to do this, but I haven't seen a complete example, and the snippets don't work (or I haven't been able to implement them successfully).

Can someone please post an example that will display the FileOpen dialogue when a button is pressed, and return one or more filepaths as a result.

I would prefer VbScript for this, however JavaScript would be acceptable as well.
           thanks,
                     PvBredow
ASKER CERTIFIED SOLUTION
Avatar of Sinoj Sebastian
Sinoj Sebastian
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>I have seen snippets of code to do this
can we have it?
Avatar of PvBredow
PvBredow

ASKER

Thanks for the replies.

<INPUT id="File1" type="file" name="File1">
is very CLOSE to what I am looking for, except for the (apparent) limitation that unlike the Windows Dialogue, it does NOT allow the user to select multiple files.        In my application, it is probable that many files would need to be selected, and although they would all be from the same directory, not all files in that directory could be selected.

           PvBredow
have a look at the link I posted.  I tried it, and it works.

I also use a (similar) method.  Minor exceptions though, what I do is force the client to selct the number of files they want to upload from a drop-down.  Once selected, that # of file fields appear (magically) on the page allowing them to browse for the files.  Problem is, they can only browse one at a time...

Very effective though, gives me great control over the number of files a client can upload....I mean, who really wants some yahoo coming to their site and trying to upload 140,000 files through one dialoge...
Thanks Kevp75.        

Am I mistaken in thinking that the actual windows dialogue can be called (as an ActiveX object)?  

Although I see the usefulness of the method you are suggesting, I would still prefer not to require the user to need to input the number of files they want to upload.        I have used the windows dialogue in VBA applications, and I am feeling a bit stubborn about trying to find a solution that works for multiple files in a single selection.

Have you gotten a chance to check out that link?
Yes, I have looked at the example link you sent.       I think that method would be useful on a small scale, but in my application the scale may not always be small.

Essentially, my application is a document repository for use in a company.     I need to give users a simple way to 'enrol' files in the system.      As all files are on the same LAN, I don't really need to upload them, but I do need to make a reference of their addresses.        In the long run, files are likely be to added a few at a time, but as the system is being rolled out, users are likely to want to add large numbers of files, although not necessarily all in a directory.         This is why I am determined to try to pursue the idea of something like the windows fileopen dialogue, which allows mutliple file selection with click, shift-click, or control-click.

Still, thanks for the suggestion.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I haven't found a suitable solution yet.       If there are no further suggestions, I will leave my application as it is, and simply force all files to be selected one at a time.

Thanks for the suggestions.
SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I haven't tested if this allows multiple files to be selected at once however.....maybe I will in due time, but it may return them as an array, or a comma separated list....

Regards,

Rob.