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.

1 Answer 1

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));
Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.