Hi @Omble, Omkar [JANIE NON-J&J],
You can refer to this link to implement uploading files using httphandler.
In the ProcessRequest method, loop through the Request.Files array and save them to a local folder using the FileSaveAs method of the HttpPostedFile class.
public void ProcessRequest(HttpContext context)
{
string filePath = "FileSave//";
//write your handler implementation here.
if (context.Request.Files.Count <= 0)
{
context.Response.Write("No file uploaded");
}
else
{
for (int i = 0; i < context.Request.Files.Count; ++i)
{
HttpPostedFile file = context.Request.Files[i];
file.SaveAs(context.Server.MapPath(filePath+file.FileName));
context.Response.Write("File uploaded");
}
}
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.