32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Text.RegularExpressions;
|
|
using System.Web;
|
|
using BreakpointTransmission.Service.Entry;
|
|
using RouterInterface;
|
|
|
|
namespace PackUploadRelease
|
|
{
|
|
public class BreakpointFilePathRouting : IHttpUploadFilePathRouting
|
|
{
|
|
public string GetUploadFilePath(HttpContext context)
|
|
{
|
|
HttpRequest _Request = context.Request;
|
|
RequestParameterEntry param = new RequestParameterEntry(context);
|
|
string fileName = param.FileName;
|
|
switch (HttpUtility.UrlDecode(_Request.Headers["x-file-type"]).ToLower())
|
|
{
|
|
case "posrelease":
|
|
return Path.Combine(_Request.MapPath("~/Upload"), "PosSystemPack", fileName);
|
|
case "servicesite":
|
|
return Path.Combine(_Request.MapPath("~/Upload"), "ServicePack", fileName);
|
|
default:
|
|
return Path.Combine(_Request.MapPath("~/Upload"), "Image", fileName);
|
|
}
|
|
}
|
|
}
|
|
}
|