RadAsyncUpload for Multiple File Upload not working properly

6 posts, 0 answers
  1. h@r!
    h@r! avatar
    20 posts
    Member since:
    Aug 2010

    Posted 30 Aug 2010 Link to this post

    Hi,
     I am using RadAsyncUpload of version 2010:1:309:0.Multiple files are being uploaded but the target folder where the files are stored is in the app_data directory of the project.Even though I gave the TargetFolder Property to a specified directory the files are being stored in app_data only.
    Can any one please let me know how to resolve this issue with AsyncUpload?

    <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" Visible="false"
                OnFileUploaded="AsyncUpload1_OnFileUploaded" OnClientAdded="addTitle" MultipleFileSelection="Automatic" >
            </telerik:RadAsyncUpload>

    protected void AsyncUpload1_OnFileUploaded(object sender, FileUploadedEventArgs e)
        {
          
            for (int i = 0; i < AsyncUpload1.UploadedFiles.Count; i++)
            {
                AsyncUpload1.TargetFolder = Server.MapPath("..\\..\\..\\Attachments\\");
                AsyncUpload1.TargetPhysicalFolder = Server.MapPath("..\\..\\..\\Attachments\\");
                AsyncUpload1.TemporaryFolder = Server.MapPath("..\\..\\..\\Attachments\\");

            }
        }

    Thanks In Advance,
    h@r!.
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2830 posts

    Posted 30 Aug 2010 Link to this post

    Hello,

    The TargetFolder property should be set in the markup or in the Page_Init method. Setting them in the OnFileUploaded event is not going to work as it's too late.

    I hope this helps.

    Regards,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. h@r!
    h@r! avatar
    20 posts
    Member since:
    Aug 2010

    Posted 30 Aug 2010 Link to this post

    Hi,
    Thanks for your response!
    I have tried in the method explained by you by adding the code as:

     private void Page_Init(object sender, EventArgs e)
        {
            AsyncUpload1.TargetFolder =Server.MapPath("..\\..\\..\\Attachments\\");
        }
    Even though I am facing the same problem i.e, a unknown format file is being uploaded into app_data folder with folder name as RadUploadTemp.
    Can you please elaborate me about the solution if I am missing anything.


    Thanks,
    h@r!.
  4. T. Tsonev
    Admin
    T. Tsonev avatar
    2830 posts

    Posted 02 Sep 2010 Link to this post

    Hi,

    Where does the "..\\..\\..\\Attachments\\" folder map to? Does the application have permission to write in this folder? What happens if you change it to Server.MapPath("~/App_Data") instead, does it work?

    I hope this helps.

    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. h@r!
    h@r! avatar
    20 posts
    Member since:
    Aug 2010

    Posted 03 Sep 2010 Link to this post

    Hi,

    The Attachment folder is having the write permissions and the files being uploaded are saved into this folder.But in App_Data folder a new folder named RadUploadTemp has been created and a temp file with name RadUploadTestFile with size 0 has been created.I just want to know why this file has been created as a temp file even though I haven't specified the temporary target folder.

    As my requirement is to store files in a particular folder and retrieve them when required I need to save them accordingly and not in the App_Data folder.

    So is there any significance for that temp file?Because even after I delete it and run the application again the file has been created in the App_Data folder.

    Thanks,
    h@r!.
  6. T. Tsonev
    Admin
    T. Tsonev avatar
    2830 posts

    Posted 07 Sep 2010 Link to this post

    Hi,

    By default, the file will be uploaded to the temporary location (App_Data/RadUploadTemp) before being transferred to its final location. This allows you to inspect the uploaded files in the code behind and filter out any files that you don't want to store.

    The temporary file location can be changed using the TemporaryFolder property.

    You can also customize the upload handler to directly store the files to their final location or even in a database. Please follow the instructions for this demo - Images Uploader.

    I hope this helps.

    Kind regards,
    Tsvetomir Tsonev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top