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????

Browser security model.

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

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.