Browsing specific local directory with FORM METHOD=POST?

J

Jay Vance

I have a page which allows users to upload files to a directory on a server.
What I'm wondering is whether or not it is possible in HTML for the form to
open a specific directory on the user's PC from which to select files, when
the user clicks on the Browse button. The purpose of this is to save the
user from having to browse through several layers of directories on their
local PC in order to find the files they want to upload, because in this
particular instance, the files are always going to be found in a specific
directory on the local machine. I would like the form to automatically look
in that specific directory when the Browse button is clicked.

Thanks for any help!

Jay
 
D

David Dorward

Jay said:
I have a page which allows users to upload files to a directory on a
server. What I'm wondering is whether or not it is possible in HTML for
the form to open a specific directory on the user's PC from which to
select files

No, it isn't.

You can't even know if a specific directory exists on the user's PC.
 
N

Nico Schuyt

I had a feeling that was the answer. Thanks for the info.
Actually, in this particular case I would know. But it's a moot point
anyway, I guess. Thanks again.

I think it has something to do with security: If you can specify a file or a
path it's easy to retreive files from the PC of a visitor.
Nico
 
J

Jay Vance

I think it has something to do with security: If you can specify a file or
a
path it's easy to retreive files from the PC of a visitor.
Nico

Yes, that makes sense.

Jay
 
G

Geoff Ball

Jay Vance said:
David Dorward wrote:
Actually, in this particular case I would know.

No, you can't. A windows user might have a particular file located at c:\My
Documents\bob\, another might have it at d:\windows\files\, and a linux
user might have it at ~/source/.config/

It's something that just isn't guaranteed, no matter how much you think you
know about your visitors.

Regards,
Geoff
 
J

Jukka K. Korpela

David Dorward said:
No, it isn't.

That's correct for almost all practical purposes. But in theory, you
can use the name="..." attribute in <input type="file" ...> to specify
the default file name for the file to be uploaded. And this could be a
pathname like
C:\emacs\misc\defaults\.emacs
You can't even know if a specific directory exists on the user's
PC.

Or if the user is using a PC at all, etc., but the default file name
can still be specified. It could be a good guess. (And it could confuse
users who work with a completely different file system. Try throwing a
VMS pathname at a typical Windows user and you'll see what I mean. :))

But it seems that Opera is the only browser that supports this feature.
More notes on this:
http://www.cs.tut.fi/~jkorpela/forms/file.html#value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top