Work with an uploaded file in ASP.NET
I need to create a custom web control which will be a part of a class library. This custom web control implements the upload functionality. I have implemented this with a web user control where I have a fixed path to a page in the web project where the upload of files take place and开发者_运维百科 it works just fine.
The created control in this class library is used in the web project. How do I post the uploaded file to a page, say SomeClass.cs, in the class library.
Thanks in advance.
You can use a file upload control to post the file to a code-behind file.
Pass the system path as a string overload?
string systemPathToFile = Server.MapPath("~/UploadedFiles/" + Path.Filename(fuFileUpload.Filename));
精彩评论