469,592 Members | 1,741 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

How to set the path value to <input type="file"> object

Hi All,

How to set the path value to file object using javascript. now i am trying to upload the file without using browse button, but i could not set the path value..

see my code:

<form name="thisForm" enctype="multipart/form-data">
<table align="center">
<tr>
<td align="left"><b>Select a file to upload :</b></td>
</tr>
<tr>
<td align="left">
<input type="file" id="filename" name="uploadfile" size="50">
</td>
</tr>
<tr>
<td align="left">
<input type="button" name="button" value="Upload" onClick="fnupload()">
</td>
</tr>
</table>
</form>

// not reflecting
document.thisForm.uploadfile.value="C:\Documents and Settings\test.txt";
document.thisForm.action="UploadFile.jsp"
document.thisForm.method="post";
document.thisForm.submit();

Thanks
Kalaivani
May 25 '07 #1
1 16727
acoder
16,027 Expert Mod 8TB
This is not supported and a good job too otherwise it would be a security hole. Imagine if someone programs a website to upload any file from your local drive onto his server.

See this page.
May 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jarrod | last post: by
1 post views Thread by Jesper Hermansen | last post: by
7 posts views Thread by Tim Slattery | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.