RadAsyncUpload Not to save to file location

Thread is closed for posting
5 posts, 0 answers
  1. Ricky
    Ricky avatar
    68 posts
    Member since:
    Dec 2007

    Posted 18 Jun 2010 Link to this post

    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
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 18 Jun 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ricky
    Ricky avatar
    68 posts
    Member since:
    Dec 2007

    Posted 20 Jun 2010 Link to this post

    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
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 23 Jun 2010 Link to this post

    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
  6. Ricky
    Ricky avatar
    68 posts
    Member since:
    Dec 2007

    Posted 24 Jun 2010 Link to this post




Back to Top
UI for ASP.NET Ajax is Ready for VS 2017