2

I have followed the below stackoverflow question and implemented all the code there.

File Upload using Twitter Bootstrap, C#, asp.net and javascript

When I actually try to upload a file it runs the code without errors but I can't tell if/where it has saved the file to as I can't see where to specify a location such as

~/Uploads/ServiceUser/uploadedfilenamehere

Any help in how to get this to save the file to the above location would be appreciated.

Community
  • 1
  • 1
Josh Cooper
  • 191
  • 1
  • 2
  • 14

1 Answers1

3

Use SaveAs method to store the file

FileUpload1.SaveAs(Server.MapPath("~/Uploads/ServiceUser/" + uploadedFileName));

EDIT

I'm assuming you've used the accepted answer on the link you posted in your question. If so, then it's pretty much similar to my answer as before. You just need to edit the code as follows;

myFile.PostedFile.SaveAs(Server.MapPath("~/Uploads/ServiceUser/" + uploadedFileName));
Izzy
  • 6,740
  • 7
  • 40
  • 84
  • This isn't a asp fileupload element in the code in that code i have read so I don't know what exactly is the replacement to it – Josh Cooper Jun 30 '15 at 09:20