I have a simple upload page that runs fine locally on my dev box but throws a nasty 500 error on the server, I have set the upload folder permissions to allow full control to everyone--any ideas?
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<link href="Upload.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
//<![CDATA[
function validationFailed(sender, eventArgs) {
$(".ErrorHolder").append("<p>Validation failed for '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
}
//]]>
</script>
<div class="MainWrap">
<div class="TopWrap">
<div class="Holder">
<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" AllowedFileExtensions=".txt,.csv" TargetFolder="c:\Files\Import"
OnFileUploaded="RadAsyncUpload1_FileUploaded" OnClientValidationFailed="validationFailed">
</telerik:RadAsyncUpload>
<telerik:RadButton runat="server" ID="BtnSubmit" Text="Submit" Skin="Metro">
<Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/gear.png" />
</telerik:RadButton>
<p>
Select File To Upload (formats accepted .csv,.txt, only)
</p>
<div class="ErrorHolder">
</div>
</div>
<div class="Holder Right">
<asp:Panel runat="server" ID="ResultsPanel" Visible="false">
<asp:Panel ID="ValidFiles" Visible="false" runat="server">
<p>
<asp:Label runat="server" ID="lblFileUpload" Font-Bold="True" /><br/>
<asp:Label runat="server" ID="lblBatchId"/><br/>
<asp:Label runat="server" ID="lblProcessTime"/>
</p>
<p>
<telerik:RadButton ID="BtnImport" runat="server" Text="Import" OnClick="BtnImport_Click" Skin="Metro" Visible="false">
<Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/find.png" />
</telerik:RadButton>
</p>
<br />
<asp:Label ID="lblMessage" runat="server" Visible="false" />
</asp:Panel>
<asp:Panel ID="InvalidFiles" Visible="false" runat="server">
<p>
<strong>The following files were not saved due to exceeding the maximum total size:</strong>
</p>
</asp:Panel>
</asp:Panel>
</div>
<div class="BottomWrap">
</div>
</div>
</div>
</telerik:RadAjaxPanel>
public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
Label fileName = new Label();
fileName.Text = e.File.FileName;
Session["FileName"] = e.File.FileName;
if (totalBytes < MaxTotalBytes)
{
// Total bytes limit has not been reached, accept the file
e.IsValid = true;
totalBytes += e.File.ContentLength;
}
else
{
// Limit reached, discard the file
e.IsValid = false;
}
if (e.IsValid)
{
ValidFiles.Visible = true;
ValidFiles.Controls.Add(fileName);
BtnImport.Visible = true;
lblMessage.Visible = true;
lblFileUpload.Text = @"File Upload Was Successful";
}
else
{
InvalidFiles.Visible = true;
InvalidFiles.Controls.Add(fileName);
}
}
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<link href="Upload.css" rel="Stylesheet" type="text/css" />
<script type="text/javascript">
//<![CDATA[
function validationFailed(sender, eventArgs) {
$(".ErrorHolder").append("<p>Validation failed for '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
}
//]]>
</script>
<div class="MainWrap">
<div class="TopWrap">
<div class="Holder">
<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" AllowedFileExtensions=".txt,.csv" TargetFolder="c:\Files\Import"
OnFileUploaded="RadAsyncUpload1_FileUploaded" OnClientValidationFailed="validationFailed">
</telerik:RadAsyncUpload>
<telerik:RadButton runat="server" ID="BtnSubmit" Text="Submit" Skin="Metro">
<Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/gear.png" />
</telerik:RadButton>
<p>
Select File To Upload (formats accepted .csv,.txt, only)
</p>
<div class="ErrorHolder">
</div>
</div>
<div class="Holder Right">
<asp:Panel runat="server" ID="ResultsPanel" Visible="false">
<asp:Panel ID="ValidFiles" Visible="false" runat="server">
<p>
<asp:Label runat="server" ID="lblFileUpload" Font-Bold="True" /><br/>
<asp:Label runat="server" ID="lblBatchId"/><br/>
<asp:Label runat="server" ID="lblProcessTime"/>
</p>
<p>
<telerik:RadButton ID="BtnImport" runat="server" Text="Import" OnClick="BtnImport_Click" Skin="Metro" Visible="false">
<Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/find.png" />
</telerik:RadButton>
</p>
<br />
<asp:Label ID="lblMessage" runat="server" Visible="false" />
</asp:Panel>
<asp:Panel ID="InvalidFiles" Visible="false" runat="server">
<p>
<strong>The following files were not saved due to exceeding the maximum total size:</strong>
</p>
</asp:Panel>
</asp:Panel>
</div>
<div class="BottomWrap">
</div>
</div>
</div>
</telerik:RadAjaxPanel>
public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
{
Label fileName = new Label();
fileName.Text = e.File.FileName;
Session["FileName"] = e.File.FileName;
if (totalBytes < MaxTotalBytes)
{
// Total bytes limit has not been reached, accept the file
e.IsValid = true;
totalBytes += e.File.ContentLength;
}
else
{
// Limit reached, discard the file
e.IsValid = false;
}
if (e.IsValid)
{
ValidFiles.Visible = true;
ValidFiles.Controls.Add(fileName);
BtnImport.Visible = true;
lblMessage.Visible = true;
lblFileUpload.Text = @"File Upload Was Successful";
}
else
{
InvalidFiles.Visible = true;
InvalidFiles.Controls.Add(fileName);
}
}