Hello,
Somewhere between the _27 and _38 build, the AJAXUploader stopped recognizing the .PostedFiles. The files upload to the temp directory, just like they did before, but when the I look for files in the PostedFiles propery, it returns {0} and files to move the files from the temp directory to the final location.
When it evaluates the "foreach(...)' statement, it fails and just displays the failed to save message, presumably becuase it sees no files. The Files (.info, .status, .data) for each upload attempt are in the c:\temp directory. This worked flawlessly until I updated to the _38 build.
Did the method of getting files from PostedFiles change since the _27 buld?
Below is a sample of my code ( largely taken from your sample ):
Code: C#
protected void ui_btn_SaveVideo_Click(object sender, EventArgs e)
{
VideoTitle = ui_txt_Video_Title.Text;
Description = ui_txt_Video_Desc.Text;
RequestID = Convert.ToInt32(requestID.Value);
SelectedDisplayOrder = Convert.ToInt32(ui_ddl_SortOrder3.SelectedValue);
string finalFileName = "";
foreach (EO.Web.AJAXPostedFile file in AJAXUploader1.PostedFiles)
{
if (file.TempFileName == string.Empty)
{
ui_lbl_ErrorMessage.Text = "You did not upload your file, or file upload failed. please try again.";
return;
}
//Get the temp file name
string tempFileName = file.TempFileName;
//Create the final file name based on the original file name
finalFileName = System.IO.Path.Combine(@"c:\temp\", file.ClientFileName);
//Move the file to the desired location
if(System.IO.File.Exists(finalFileName))
{
System.IO.File.Delete(finalFileName);
}
System.IO.File.Move(tempFileName, finalFileName);
break; // Just grab the first one if the user uploaded more files.
}
if (finalFileName == string.Empty)
{
ui_lbl_ErrorMessage.Text = "Could not save the uploaded file, please try uploading again.";
return;
}
Thanks