简体   繁体   中英

File Upload withTwitter Bootstrap, C#, asp.net and javascript

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.

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));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM