ASP . NET - Local file directory using Chrome

Asked

Viewed 191 times

0

I have the following code snippet:

<div class='upload-border'>
   <input class='file-upload' id="fileUpload" runat="server" type="file" name='upload'/>
</div>

I need to get the local file directory I just selected. With C#, when I use fileUpload.Value in Internet Explorer, you are returning me the correct directory, for example: C: temp myfile.txt. In Chrome, just give me the file name.

I need the complete directory because I need to save this content.

How can I get the directory complete with C#?

1 answer

1


Friend due to security policy issues google Chrome does not show the file path, it always shows a "fakepath" in place of the machine’s local path, what you can do in c# is to submit the form that is your input file and pick up the file with

Request.Files["nameInput"].

I hope I’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.