Valli, I am also getting this error with the 5.0 beta. Do you have a solution? Also, the ExtensionsAllow property seems to have no effect.
The UploadProgress when set to Inline shows:
Server Error in '/FormsFullCirclePrototype' Application.
HTTP Error 400 - Bad Request.
Version Information: ASP.NET Development Server 8.0.0.0
Here is my code:
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AttachFiles.aspx.cs" Inherits="AttachFiles" Title="FormsFullCircle - Attach Files" %>
<%@ Register Assembly="Syncfusion.Tools.Web, Version=5.102.0.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89"
Namespace="Syncfusion.Web.UI.WebControls.Tools" TagPrefix="cc1" %>
And my codebehind:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Syncfusion.Web.UI.WebControls.Tools;
using Syncfusion.Web.UI.WebControls.Tools.UploadControl;
public partial class AttachFiles : System.Web.UI.Page
{
private ArrayList _listOfUploadedFilenames;
protected void Page_Load(object sender, EventArgs e)
{
if (ViewState["UploadedFilenames"] == null)
{
_listOfUploadedFilenames = new ArrayList();
}
else
{
_listOfUploadedFilenames = (ArrayList)ViewState["UploadedFilenames"];
}
//if (!Page.IsPostBack)
//{
//string stringAllowedExtensions = "pdf;txt;rtf;doc;xls;jpg;tif";
//UploadBox1.ExtensionsAllow = stringAllowedExtensions;
//UploadBox2.ExtensionsAllow = stringAllowedExtensions;
//UploadBox3.ExtensionsAllow = stringAllowedExtensions;
//UploadBox4.ExtensionsAllow = stringAllowedExtensions;
//UploadBox5.ExtensionsAllow = stringAllowedExtensions;
string stringSessionFolderPath = (string)Session["SessionFolderPath"];
UploadBox1.UploadFolder = stringSessionFolderPath;
UploadBox2.UploadFolder = stringSessionFolderPath;
UploadBox3.UploadFolder = stringSessionFolderPath;
UploadBox4.UploadFolder = stringSessionFolderPath;
UploadBox5.UploadFolder = stringSessionFolderPath;
//}
}
//protected void FileUploaded(object sender, EventArgs e)
//{
// Label2.Text += ((UploadBox)sender).FileName + " successfully uploaded. ";
//}
protected void UploadButton_Click(object sender, EventArgs e)
{
string stringFilenames = string.Empty;
if ((this.UploadBox1.IsUploaded))
{
stringFilenames = stringFilenames + this.UploadBox1.FileName + ", ";
RenameAndTrackUploadedFiles(this.UploadBox1.File);
}
if ((this.UploadBox2.IsUploaded))
{
stringFilenames = stringFilenames + this.UploadBox2.FileName + ", ";
RenameAndTrackUploadedFiles(this.UploadBox2.File);
}
if ((this.UploadBox3.IsUploaded))
{
stringFilenames = stringFilenames + this.UploadBox3.FileName + ", ";
RenameAndTrackUploadedFiles(this.UploadBox3.File);
}
if ((this.UploadBox4.IsUploaded))
{
stringFilenames = stringFilenames + this.UploadBox4.FileName + ", ";
RenameAndTrackUploadedFiles(this.UploadBox4.File);
}
if ((this.UploadBox5.IsUploaded))
{
stringFilenames = stringFilenames + this.UploadBox5.FileName;
RenameAndTrackUploadedFiles(this.UploadBox5.File);
}
if (stringFilenames != string.Empty)
{
Label2.Text = "Uploaded: " + stringFilenames;
}
}
private void RenameAndTrackUploadedFiles(UploadFile uploadFile)
{
string stringSessionFolderPath = (string)Session["SessionFolderPath"];
string stringNewFilename = stringSessionFolderPath + "\\" + Guid.NewGuid().ToString() + uploadFile.File.Extension;
uploadFile.MoveTo(stringNewFilename, true);
_listOfUploadedFilenames.Add(stringNewFilename);
}
protected void SkipButton_Click(object sender, EventArgs e)
{
Label2.Text = "Skipped";
}
protected void ContinueButton_Click(object sender, EventArgs e)
{
Label2.Text = "Continued";
}
}