开发者

How get a real path value to file that store local on HDD from input or FileUpload?

开发者 https://www.devze.com 2023-03-18 02:24 出处:网络
I have two file uploaders: <input name=\"targetFile\" runat=\"server\" id=\"File1\" type=\"file\" />

I have two file uploaders:

<input name="targetFile" runat="server" id="File1" type="file" /> 
<asp:FileUpload ID="FileUpload1" runat="server" />

When I click to choose file (for exa开发者_StackOverflowmple D:\Test.txt) the way to file appears on control, but when I get value control in javascript:

obj = document.getElementById("File1");

value of the path to file store local:

obj.value = "C:\fakepath\Test.txt" 

I need to get actualy "D:\Test.txt" string on javascript. Can it be done?


Do you have a

subst D: C:\fakepath\

?
or how do you mix c: and d:?

0

精彩评论

暂无评论...
验证码 换一张
取 消