This is a migrated thread and some comments may be shown as answers.

RadAsyncUpload SaveAs Throws Access Denied error After Saving File Successfully

3 Answers 247 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Kristopher
Top achievements
Rank 1
Kristopher asked on 02 Oct 2014, 04:40 PM
Hey, 


   I set my TemporaryFolder to a temporary folder where the DefaultAppPool has read and write access.  One of my RadAsyncUploadControls uses an httphandler to save files to this folder using the base.Process() method. There is no problem with this.

   I have another AsyncUpload control which I'm trying to Save the file to this temporary folder using the SaveAs method.  When I execute the SaveAs method, it successfully saves this file into the temp folder with a random string appended to it as it should, then throws an access denied error.  This doesn't make much sense to me, since it successfully saved the file already in its entirety.  Any ideas why this is happening?

3 Answers, 1 is accepted

Sort by
0
Hristo Valyavicharski
Telerik team
answered on 07 Oct 2014, 07:53 AM
Hi Kristopher,

When the FileSaveAs() method is called the AsyncUpload will move the temporary file from Temporary to Target folder. If you want to keep the temporary file you will have to save it by reading and storing the file stream. 

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
Luke
Top achievements
Rank 2
answered on 17 Apr 2017, 04:48 PM

[quote]
AsyncUpload will move the temporary file from Temporary to Target folder. [/quote]

Hello,

I'm having the same issue as Kristopher, but I'm specifying the destination  using file.SaveAs(Server.MapPath(docPath), True)

The temporary folder is full of files, but it hangs when it tries to move the file

 

Thanks

0
Peter Milchev
Telerik team
answered on 20 Apr 2017, 03:33 PM
Hello Luke,

Most probably the stream is not closed when the file should be removed. Would you please confirm that the file stream is closed after the file is successfully saved? 

Here is an article related to the topic: Should I call Close() or Dispose() for stream objects?.

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
AsyncUpload
Asked by
Kristopher
Top achievements
Rank 1
Answers by
Hristo Valyavicharski
Telerik team
Luke
Top achievements
Rank 2
Peter Milchev
Telerik team
Share this question
or