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
Douglas

Recommended Answers

All 2 Replies

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

commented: Just exactly the answer I needed +3

Well DUH!!... thank you.

No clue what I was thinking about...

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.