0

I have a file upload control, when users hit browse and select the file residing on their machine. After that I have a button which posts back to an action method and parses through the file and the populates a few fields in the model on the page. Then they hit the save button and It saves the files since I persist the file path in a hidden field. My problem is in my local development environment everything works fine. When I deploy it on a server, The code does not parse the file. Is it possible that the file is not being parsed because server cannot directly open and read a file which exists on users machine?

Thank you

user1475788
  • 123
  • 11

1 Answers1

1

Is it possible that the file is not being parsed because server cannot directly open and read a file which exists on users machine?

Exactly. If you want to save the file, save it during the first post. You can't just read up a file from the user's computer from a webpage.

Edit:

Check this answer about how to do file upload in MVC3: https://stackoverflow.com/a/5193851/618331

Community
  • 1
  • 1
Akos Lukacs
  • 2,007
  • 1
  • 16
  • 21