asp:FileUpload error

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I have the following code to upload a file via an <span style="color:maroon; font-family:Verdana,sans-serif; font-size:9.5pt
asp<span style="color:blue; font-family:Verdana,sans-serif; font-size:9.5pt :<span style="color:maroon; font-family:Verdana,sans-serif; font-size:9.5pt FileUpload
control.
<span style="color:blue; font-family:Verdana,sans-serif; font-size:9.5pt string<span style="font-family:Verdana,sans-serif; font-size:9.5pt strFileName = FileUpload1.PostedFile.FileName;<span>

<span style="color:#2b91af; font-family:Verdana,sans-serif; font-size:9.5pt FileStream<span style="font-family:Verdana,sans-serif; font-size:9.5pt fStream =
<span style="color:#2b91af File.OpenRead(strFileName);
<span style="color:blue; font-family:Verdana,sans-serif; font-size:9.5pt byte<span style="font-family:Verdana,sans-serif; font-size:9.5pt [] binFile =
<span style="color:blue new <span style="color:blue byte[fStream.Length];
It works fine in the Server box. However, I get the following error in a remote pc:
<span style="color:black; font-family:Verdana,sans-serif Exception Details:
<span style="color:black; font-family:Arial,sans-serif System.IO.FileNotFoundException: Could not find file c:windowssystem32inetsrvCHItext.txt.
My file path is <span> d:tempchitext.txt. It was correct in the upload field. I do not know why the system try to local from c:windwssystem32inetsrv? I really appreciate if someone can help me out. Many thanks.

View the full article
 
Back
Top