It seems to fail on this line
var f=e.get_handled();
if(!f){throw"Error while uploading, "+i;a("object",j).remove();
But if I try again it works. And if the cache isn't cleared it works. I moved the custom javascript to the bottom and I think the web.config is ok, but here is my code:
var f=e.get_handled();
if(!f){throw"Error while uploading, "+i;a("object",j).remove();
But if I try again it works. And if the cache isn't cleared it works. I moved the custom javascript to the bottom and I think the web.config is ok, but here is my code:
<%@ Page Language="C#" AutoEventWireup="true" Inherits="AssocUploader" CodeBehind="AssocUploader.aspx.cs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
type
=
"text/javascript"
src
=
"http://cdn.kendostatic.com/2014.1.416/js/jquery.min.js"
></
script
>
</
head
>
<
body
style
=
"font-family: Verdana; font-size: 12px; background-color: lightblue"
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManagerAssocUp"
EnablePartialRendering
=
"true"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManagerAAUp"
runat
=
"server"
/>
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"RadAjaxPanelAAUp"
>
<
div
>
<
table
>
<
tr
>
<
td
style
=
"text-align: center"
colspan
=
"2"
>
<
asp:Label
Text
=
"Upload File with Description"
Font-Bold
=
"true"
Font-Size
=
"15px"
runat
=
"server"
/>
<
br
/>
<
br
/>
</
td
>
</
tr
>
<
tr
>
<
td
>File Description</
td
>
<
td
>
<
telerik:RadTextBox
runat
=
"server"
Width
=
"200px"
ID
=
"tbFileDesc"
/>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
>
<
br
/>
<
telerik:RadAsyncUpload
ID
=
"radUpAssoc"
runat
=
"server"
Width
=
"250px"
OnClientFileUploaded
=
"fileUploaded"
DisablePlugins
=
"true"
ChunkSize
=
"2097152"
DisableChunkUpload
=
"False"
MultipleFileSelection
=
"Disabled"
OnClientFileUploadFailed
=
"onFileFailed"
ManualUpload
=
"true"
OnClientFileUploading
=
"onClientFileUploading"
HttpHandlerUrl
=
"~/AssocUploadHandler.ashx"
AllowedFileExtensions
=
"pdf"
>
</
telerik:RadAsyncUpload
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
input
type
=
"button"
onclick
=
"startManualUpload()"
value
=
"start upload"
/>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
asp:Label
Text
=
""
ForeColor
=
"DarkRed"
runat
=
"server"
ID
=
"txtError"
/>
<
br
/>
<
asp:Label
Text
=
""
ForeColor
=
"DarkGreen"
runat
=
"server"
ID
=
"txtDebug"
/>
</
td
>
</
tr
>
</
table
>
</
div
>
</
telerik:RadAjaxPanel
>
</
form
>
<
telerik:RadCodeBlock
runat
=
"server"
ID
=
"radCodeBlock1"
>
<
style
type
=
"text/css"
>
.RadUpload_Default .ruFakeInput {
display: none !important;
}
</
style
>
<
script
type
=
"text/javascript"
>
function fileUploaded(sender, args) {
document.getElementById("txtDebug").innerText = 'File has uploaded. Close the window or add another file';
}
function onFileFailed(sender, args) {
document.getElementById("txtDebug").innerText = '';
document.getElementById("txtError").innerText = 'File Upload Failed';
}
function startManualUpload() {
var tb = $find('<%=tbFileDesc.ClientID%>');
var tbtxt;
try {
tbtxt = tb._text.length;
}
catch (err) {
document.getElementById("txtError").innerText = 'Description Error:' + err;
return;
}
if (tbtxt == 0) {
document.getElementById("txtError").innerText = 'Enter Description';
}
else {
try {
var upload = $find('<%=radUpAssoc.ClientID%>');
upload.startUpload();
document.getElementById("txtError").innerText = '';
}
catch (err) {
document.getElementById("txtError").innerText = 'Upload Exception:' + err;
return;
}
}
}
function onClientFileUploading(sender, args) {
var tb = $find('<%=tbFileDesc.ClientID%>');
var tbtxt = tb._text
var obj = { desc: tbtxt };
args.set_queryStringParams(obj);
}
if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
</
script
>
</
telerik:RadCodeBlock
>
</
body
>
</
html
>