Hi expert,
I have this exception when excuting this code:
then exception occurs:
Could not find file 'xxx\App_Data\RadUploadTemp\mq1ukeso.2dm'.
During debugging, I noticed that temp file 'mq1ukeso.2dm' is existed just before excuting 'SaveAs' method, and it disappear when excuting 'SaveAs...' method, is there any obvious mistake I made? many thanks for your help!
my aspx page:
I have this exception when excuting this code:
If AsyncUpload1.UploadedFiles.Count > 0 Then
AsyncUpload1.UploadedFiles(0).SaveAs(Server.MapPath(
"/documents") & fileName, True)
End If
then exception occurs:
Could not find file 'xxx\App_Data\RadUploadTemp\mq1ukeso.2dm'.
During debugging, I noticed that temp file 'mq1ukeso.2dm' is existed just before excuting 'SaveAs' method, and it disappear when excuting 'SaveAs...' method, is there any obvious mistake I made? many thanks for your help!
my aspx page:
<
telerik:RadAsyncUpload
ID
=
"AsyncUpload1"
runat
=
"server"
OnClientFileUploaded
=
"OnClientFileUploaded"
MaxFileSize
=
"2097152"
MaxFileInputsCount
=
"1"
AutoAddFileInputs
=
"false"
/>
7 Answers, 1 is accepted
0
Shinu
Top achievements
Rank 2
answered on 29 Oct 2013, 07:24 AM
Hi Ray,
There can be two possibilities behind such an error associated with the temp file.
1) You may be using an older version of Telerik RadControls which has such a known issue. You can upgrade to the latest version in which this issue is fixed.
2) When a file is uploaded by the RadAsyncUpload control it is placed in a temporary folder. After a certain time (by default 4 hours) the files from the temporary folder are deleted by the asp.net framework. If the TemporaryFileExpiration property is set, the expiration time will be different and it is possible the files to be deleted before your logic after the postback is applied and that should be causing the sporadic throwing of exceptions.
Hope this helps,
Shinu.
There can be two possibilities behind such an error associated with the temp file.
1) You may be using an older version of Telerik RadControls which has such a known issue. You can upgrade to the latest version in which this issue is fixed.
2) When a file is uploaded by the RadAsyncUpload control it is placed in a temporary folder. After a certain time (by default 4 hours) the files from the temporary folder are deleted by the asp.net framework. If the TemporaryFileExpiration property is set, the expiration time will be different and it is possible the files to be deleted before your logic after the postback is applied and that should be causing the sporadic throwing of exceptions.
Hope this helps,
Shinu.
0
Ray
Top achievements
Rank 1
answered on 29 Oct 2013, 03:08 PM
hmm, still not working, my telerik.web.ui.dll version is 2013.2.611.40, and my code again (this time I specified the expire time to 5 hours):
the strange part is that I can see the temp file as long as I didn't execute method 'SaveAs...', and it seems like it got removed JUST right before 'SaveAs' method run... so I don't think it's anything to do with the value of TemporaryFileExpiration?
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function OnClientFilesUploaded(sender, args) {
$find('<%= RadAjaxManager1.ClientID %>').ajaxRequest();
ValidatorValidate(CustomValidator);
}
function OnClientFileUploaded(sender, args) {
document.getElementById('divReplace').style.display = 'block';
}
function validateUpload(sender, args) {
var upload = $find("RadAsyncUpload1");
args.IsValid = upload.getUploadedFiles().length != 0;
}
</
script
>
</
telerik:RadScriptBlock
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
EnablePageHeadUpdate
=
"false"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<telerik:RadAsyncUpload ID="AsyncUpload1" runat="server"
OnClientFileUploaded="OnClientFileUploaded"
TemporaryFileExpiration="05:00:00"
MaxFileSize="2097152" MaxFileInputsCount="1"
AutoAddFileInputs="false" />
the strange part is that I can see the temp file as long as I didn't execute method 'SaveAs...', and it seems like it got removed JUST right before 'SaveAs' method run... so I don't think it's anything to do with the value of TemporaryFileExpiration?
0
Accepted
0
Ray
Top achievements
Rank 1
answered on 12 Nov 2013, 08:33 AM
Thanks, your code works and I think my old code was not right so what I did is I merged my code with yours, thanks!
0
Bálint
Top achievements
Rank 1
answered on 04 Oct 2014, 04:05 PM
Dear Shinu, I have the exactly same problem. I have tried to download the sample solution but already not reachable.
Do you create an another link for me?
Thanks
Do you create an another link for me?
Thanks
0
Hi Bálint,
It looks like that the sample's link is inactive. What are you trying do? The temporary file should be accessible in the OnFileUploaded event.
Regards,
Hristo Valyavicharski
Telerik
It looks like that the sample's link is inactive. What are you trying do? The temporary file should be accessible in the OnFileUploaded event.
Regards,
Hristo Valyavicharski
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Bálint
Top achievements
Rank 1
answered on 13 Oct 2014, 11:00 AM
Hi Hristo!
Thank you, but meanwhile I managed to resolve my problem with this control.
So everything is fine now.
Thanks!
Thank you, but meanwhile I managed to resolve my problem with this control.
So everything is fine now.
Thanks!