File name input

Khayman

I'm sorry Hal...
Political Access
Joined
6 Jan 2002
Messages
5,518
Ok, so I want to get the path to a file and send it to the server

I thought I could used the input type="file" thing because that automatically puts the little browse button on the page, which is neat.

BUT

That method sends the whole file to the server and I just want the path and filename.

So I want the browse button, which pops open a file selection window but not actual send the file

It seems simple to do, but I'm drawing a blank (except possibly with javascript), anyone?
 
Just one question. What good would the filename and path be to the server? Or are you doing some kind of playlist generator or something similar?

I'm not sure if Javascript could do this at all, I don't think it has access to the file system.
 
It doesn't matter, I just want to be able to select a file and then store the path as a string
 
I've got an idea... Not sure if it'll work at all, but:

You use a regular file input in, say, form1. The the submit button doesn't submit, but rather starts a Javascript function which reads the file name from the file input (if this is possible, never tried), writes it into a hidden input in form2, and then submits form2. Sounds doable?
 
I've already tried that. I don't like it, isn't very cross browser friendly.
 
Khayman said:
I've already tried that. I don't like it, isn't very cross browser friendly.


All browsers should be able to support it, other than the older ones, plus it is the only way one can do it. It is IMHO the best solution for now.
 
Think i've got it sorted now. Originaly I was using a slight variation which was using a method which only works in IE, but is ok now
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back