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

RadAsyncUpload for Multiple File Upload not working properly

5 Answers 476 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
h@r!
Top achievements
Rank 1
h@r! asked on 30 Aug 2010, 07:15 AM
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!.

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Aug 2010, 08:21 AM
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
0
h@r!
Top achievements
Rank 1
answered on 30 Aug 2010, 08:47 AM
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!.
0
T. Tsonev
Telerik team
answered on 02 Sep 2010, 03:56 PM
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
0
h@r!
Top achievements
Rank 1
answered on 03 Sep 2010, 06:08 AM
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!.
0
T. Tsonev
Telerik team
answered on 07 Sep 2010, 03:40 PM
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
Tags
AsyncUpload
Asked by
h@r!
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
h@r!
Top achievements
Rank 1
Share this question
or