开发者

Work with an uploaded file in ASP.NET

开发者 https://www.devze.com 2023-02-17 11:23 出处:网络
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

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号