//http://localhost/myapp/User/MultiPhotoUpload.aspx?threadID=20&threadTypeID=3
//HttpContext.Current.Handler.ProcessRequest(HttpContext.Current);
HttpContext.Current.CurrentHandler.ProcessRequest(HttpContext.Current);
HttpRequest request = Context.Request;
string testRequest = request.QueryString["threadID"];
string thisFormThreadID = this.Request.Form["threadID"];
string thisThreadID = this.Request.QueryString["threadID"];
//HttpContext context = new base.Request.QueryString["threadID"];
string testThreadID = HttpContext.Current.Request.QueryString["threadID"];
string formThreadID = HttpContext.Current.Request.Form["threadID"];
//HttpContext.Current.Handler.ProcessRequest(HttpContext.Current);
string baseThreadID = base.Request.QueryString["threadID"];
string contextThreadID = base.Context.Request.QueryString["threadID"];
string threadID = Context.Request.QueryString["threadID"];
Here is my SaveChunkData method, why is my threadID value always null. I must not understand something, please enlighten me, thanks.
public
override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
{
bool result = base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);
try
{
if (this.IsFinalFileRequest())
{
//If the file is successfully uploaded.
if (result)
{
string threadID = this.Request.Form["threadID"];
if (!String.IsNullOrEmpty(this.Request.Form["threadID"]))
{
if (!SYLWebUtility.ImageHelper.VerifyDirectoryExistsForNewFile(this.GetFilePath()))
{
this.AddReturnParam(RadUploadConstants.ParamNameMessage, UserInterfaceMessages.UserInterfaceMessage.ErrorMessage(UserInterfaceMessages.Enumerations.UIErrorMessage.ProblemsAddingData, SYLWebUtility.LanguageHelper.GetLanguageIDByTwoLetterISOLanguageName()));
this.ReturnMandatoryParameters(result, this.IsFinalFileRequest());
return result;
}
this.SaveFiles();
}
else
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
}
}
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
catch (Exception)
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
}
public
override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
{
bool result = base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);
try
{
if (this.IsFinalFileRequest())
{
//If the file is successfully uploaded.
if (result)
{
string threadID = this.Request.Form["threadID"];
if (!String.IsNullOrEmpty(this.Request.Form["threadID"]))
{
if (!SYLWebUtility.ImageHelper.VerifyDirectoryExistsForNewFile(this.GetFilePath()))
{
this.AddReturnParam(RadUploadConstants.ParamNameMessage, UserInterfaceMessages.UserInterfaceMessage.ErrorMessage(UserInterfaceMessages.Enumerations.UIErrorMessage.ProblemsAddingData, SYLWebUtility.LanguageHelper.GetLanguageIDByTwoLetterISOLanguageName()));
this.ReturnMandatoryParameters(result, this.IsFinalFileRequest());
return result;
}
this.SaveFiles();
}
else
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
}
}
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
catch (Exception)
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
}
public
override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
{
bool result = base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);
try
{
if (this.IsFinalFileRequest())
{
//If the file is successfully uploaded.
if (result)
{
string threadID = this.Request.Form["threadID"];
if (!String.IsNullOrEmpty(this.Request.Form["threadID"]))
{
if (!SYLWebUtility.ImageHelper.VerifyDirectoryExistsForNewFile(this.GetFilePath()))
{
this.AddReturnParam(RadUploadConstants.ParamNameMessage, UserInterfaceMessages.UserInterfaceMessage.ErrorMessage(UserInterfaceMessages.Enumerations.UIErrorMessage.ProblemsAddingData, SYLWebUtility.LanguageHelper.GetLanguageIDByTwoLetterISOLanguageName()));
this.ReturnMandatoryParameters(result, this.IsFinalFileRequest());
return result;
}
this.SaveFiles();
}
else
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
}
}
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
catch (Exception)
{
if (SYLWebUtility.ImageHelper.VerifyFileExists(this.GetFilePath()))
{
//Deletes the specified file. An exception is not thrown if the specified file does not exist.
System.IO.
File.Delete(this.GetFilePath());
}
ReturnMandatoryParameters(result,
this.IsFinalFileRequest());
return result;
}
}
//string threadID = HttpContext.Current.Request.QueryString["threadID"];
//string tID = this.Request.Form["threadID"];
//string thID = this.Request.QueryString["threadID"];
//string threadID = Request.QueryString["threadTypeID"];