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

RadAsyncUpload Not to save to file location

4 Answers 394 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ricky
Top achievements
Rank 2
Ricky asked on 18 Jun 2010, 05:48 AM
Hi there

Is there a way around to get the files and not to save to any file location. I want to upload multiple files with RadAsyncUpload and not with simple rad upload.

I want to send the uploaded file as an email attachment. So i don't want to save them any where and for uploading I want to do it with RadAsyncUpload.
 
Similar control one below this email editor.

Any help will be much appreciated.

Thanks
Ricky

4 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 18 Jun 2010, 09:40 AM
Hi Ricky,

Yes, this can be achieved quite easy. Here are the steps:

1) Declare RadAsyncUpload without setting TargetFolder. Like this:

<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1"
        onfileuploaded="RadAsyncUpload1_FileUploaded">
    </telerik:RadAsyncUpload>

2) In the FileUploaded event add the uploaded files to a generic List<UploadedFile>

IList<UploadedFile> files;
 
    protected void Page_Load(object sender, EventArgs e)
    {
        files = new List<UploadedFile>();
    }
    protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        files.Add(e.File);
    }


3) In the Click handler for the Submit button use the files collection to save them as attachments.

Sincerely yours,
Genady Sergeev
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
Ricky
Top achievements
Rank 2
answered on 21 Jun 2010, 12:24 AM
Hi Sergeev,

Thanks for your help. but this solution did not worked for me. I can add/remove files i think and then when i press the send button i don't get anything from the file List.

That was something i was trying before to save as a array of posted files and then in a session variable. The issue with that is of course you know the session variable appear to have on all the opened windows.

So can you please help me with that or there any sample for that which i can download and play.

One more thing i want to know is that how i can change the look of RadAsyncUpload. Because i want to see list of files separated with commas.

Thanks
Ricky
0
Genady Sergeev
Telerik team
answered on 23 Jun 2010, 03:31 PM
Hello Ricky,

With respect to your first question - sample project demonstrating the approach is attached to this replay. Regarding the layout you want to achieve, I am not sure that this is possible without changes to the RadAsyncUpload rendering mechanism. I will try to find a solution and post it here I manage to.

Kind regards,
Genady Sergeev
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
Ricky
Top achievements
Rank 2
answered on 24 Jun 2010, 07:04 AM



Tags
Upload (Obsolete)
Asked by
Ricky
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Ricky
Top achievements
Rank 2
Share this question
or