In my form I am asking the user to enter a file name. After browsing the textfield does show the full path and name but both GET and my javascript can only return the file name without the path. Obviously I am going to need the path as well to be able to upload the file.
From the body:
<p>File:
<span id="sprytextfield5">
<input name="dw_Abstract" type="file" required="required" id="dw_Abstract" tabindex="30" size="66" />
<span class="textfieldRequiredMsg">Please enter the file name for your abstract.</span>
</span><br />
<font size="-1">(Document type - plain text (txt) file only, please, up to 20kB.)</font>
</p>
From my JavaScript:
function GetSpryValue(SName)
{
return document.getelementById(SName).value;
}
$Doc_AbstractFile = GetSpryValue("dw_Abstract");
Thanks, Mike
A few other details.
I'm getting these results using Firefox. When I use IE I get something like "C:/fakepath/filename.txt"
FakePath???
If interested, and you want to try it yourself, use this link: http://www.kstreetstudio.com/daviswrites/test/getwork.html Use the name "Meier" and ID "dw2012_002".
Mike
I finally had time to google "FlaePath" and found that browsers do not generally reveal the path on the client computer.
I had been grabbing the path and storing it in a string, using JavaScript, saving it in a cookie, and uploading the file via another page after the user has had a chance to verify everything. It looks like I will have to rethink this.
North America
Europe, Middle East and Africa
Asia Pacific