I am testing the AjaxFileupload control. It works fine on my local machine but when I move the website to the server I am receiving the following error:
Could not find a part of the path 'C:\Windows\TEMP_AjaxFileUpload\3F2E1906-7D26-0E6A-9184-FEAE8722BD24\'.
Here is my html:
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>File Upload Test</title>
<scripttype="text/javascript">
function uploadError(sender, args) {
document.getElementById("spanError").innerHTML = args.responseText;
}
</script>
</head>
<body>
<formid="form1"runat="server">
<div>
<ajaxToolkit:AjaxFileUploadID="ajaxUpload1"runat="server"OnUploadComplete="ajaxUpload1_UploadComplete"AllowedFileTypes="pdf,tif"ClientIDMode="AutoID"OnClientUploadError="uploadError"MaximumNumberOfFiles="1"/>
</div>
<div>
<spanid="spanError"></span>
</div>
</form>
</body>
</html>
Here is my code behind:
ProtectedSub ajaxUpload1_UploadComplete(sender AsObject, e As AjaxControlToolkit.AjaxFileUploadEventArgs)
Dim filePath AsString = Server.MapPath("UploadedFiles")
filePath += "\"& e.FileName
ajaxUpload1.SaveAs(filePath)
EndSub