Can someone tell me how to extract a fully qualified URL from a form input

<input type="file" name="datafile">

When I use this in a form and navigate to a picture like domainname.com/images/banners/banner1.jpg

The only thing I get back is banner1.jpg

Am I missing something (besides the file path).

thanks in advance

2 Years
Discussion Span
Last Post by showman13

What's your purpouse? You cannot access the client path of an uploaded file, because the browser operates in a sandbox and will send only the file and the name.

If instead you simply want a link, then you cannot use the file input control, use text or if using HTML5, url:

<input type="text" name="link" />
<input type="url" name="link" />

the only difference between the two is the user experience, Google Chrome, for example, will require the user to type an url provided by the protocol, for example: http://, ftp://, file://.

More information here: http://diveintohtml5.info/forms.html

Edited by cereal

Votes + Comments
Just exactly the answer I needed
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.