0
Answer

How to Slit and merge File in ashx before upload

DEEPU MOHAN

DEEPU MOHAN

7y
255
1
am using  html  file uploader to upload file its working in js and ashx . but last wek i notice a problem when i try to upload a large file its not working, so i try to modify my ashx code i want to split my file as packages and upload it can any one help me how it can acive .
 
 
 my ashx code is given below
 
else if (file.ContentType == "application/octet-stream" || file.ContentType == "application/pdf"|| file.ContentType == "application/pdf")
{

fName = IdcGlobal.Agora.Core.Core.InvocationID + Path.GetExtension(file.FileName);
if (HttpContext.Current.Request.Browser.Browser.ToUpper() == "IE" || HttpContext.Current.Request.Browser.Browser.ToUpper() == "INTERNETEXPLORER")
{
string[] testfiles = file.FileName.Split(new char[] { '\\' });
}
fPath = Path.Combine(context.Server.MapPath(string.Format(ConfigurationManager.AppSettings["Site.FileUpload.Path"], Recordtypename)), fName);
file.SaveAs(fPath);
sHost = HttpContext.Current.Request.Url.Host.ToString();
sPort = HttpContext.Current.Request.Url.Port.ToString();
//imageUrl = (sPort != "80" && sHost.IndexOf("localhost") != -1) ? sHost + ":" + sPort : sHost;
imageUrl = string.Format(ConfigurationManager.AppSettings["Site.FileUpload.Path"], Recordtypename) + fName;
imageUrl = imageUrl.Replace("~/", "/");
FileXml = string.Format("<df-xml><file url=\"{0}\" creator=\"8\" creator-ide=\"cws\" title=\"{1}\" content-type=\"{2}\" file-name=\"{3}\" /></df-xml>", imageUrl, ImageTitle, file.ContentType, file.FileName);
context.Response.ContentType = "text/plain";
context.Response.Write(FileXml);
}