954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Truncation of file path at last backslash.

I have html as follows:

<input type="file" name="p_pict" />
<input type="button" value="Upload" onclick="p_Upload()"/>


With the Browse button I get a full file pathname including backslashes.

The javascript is:

function p_Upload()
{
    alert(document.forms[0].p_pict.value);
}


The alert displays only the file name. Everything up to the last backslash is removed.

Why????

GeoffC
Newbie Poster
19 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

Browser security model.

Airshow
WiFi Lounge Lizard
Moderator
2,682 posts since Apr 2009
Reputation Points: 321
Solved Threads: 372
 

Thanks Airshow. I will have to use a different approach.

GeoffC
Newbie Poster
19 posts since Nov 2004
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You