RadAsyncUpload SaveAs Throws Access Denied error After Saving File Successfully

4 posts, 0 answers
  1. Kristopher
    Kristopher avatar
    13 posts
    Member since:
    Jul 2013

    Posted 02 Oct 2014 Link to this post


       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?
  2. Hristo Valyavicharski
    Hristo Valyavicharski avatar
    975 posts

    Posted 07 Oct 2014 Link to this post

    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. 

    Hristo Valyavicharski

    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.

  3. Luke
    Luke avatar
    1 posts
    Member since:
    Nov 2016

    Posted 17 Apr 2017 in reply to Hristo Valyavicharski Link to this post

    AsyncUpload will move the temporary file from Temporary to Target folder.


    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



  4. Peter Milchev
    Peter Milchev avatar
    781 posts

    Posted 20 Apr 2017 Link to this post

    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?.

    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.
Back to Top