You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace QW2021C.Administration
|
|
{
|
|
/// <summary>
|
|
/// Zusammenfassungsbeschreibung für saveFiles
|
|
/// </summary>
|
|
public class saveFilescsv : IHttpHandler
|
|
{
|
|
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
string targetFolder = HttpContext.Current.Server.MapPath("~/Upload");
|
|
|
|
HttpRequest request = context.Request;
|
|
|
|
HttpFileCollection uploadedFiles = context.Request.Files;
|
|
|
|
if (uploadedFiles != null && uploadedFiles.Count > 0)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < uploadedFiles.Count; i++)
|
|
|
|
{
|
|
|
|
if (uploadedFiles[i].FileName != null && uploadedFiles[i].FileName != "")
|
|
|
|
{
|
|
|
|
string fileName = uploadedFiles[i].FileName;
|
|
|
|
int index = fileName.LastIndexOf("\\");
|
|
|
|
if (index > -1)
|
|
|
|
{
|
|
|
|
fileName = fileName.Substring(index + 1);
|
|
|
|
}
|
|
|
|
uploadedFiles[i].SaveAs(targetFolder + "\\" + fileName);
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
} |