AjaxUploader Thumbnail image

Last post 12-29-2009, 2:04 PM by Eric. 1 replies.
Sort Posts: Previous Next
  •  12-29-2009, 10:46 AM 57965

    AjaxUploader Thumbnail image

    Hi,
     
    I would like to be able to show a thumnail image of an uploaded file. I would also like to be able to hook into the "remove" event.
     
    I would like my system to work as follows:
     
    1. User uploads an image
    2. I rename the image "whatever.jpg"
    3. A thumbnail is shown of the uploaded image
    4. When a user clicks remove, the resx file is removed AND the temporary image I have copied is removed
     
    I would also like the user to be able to see the thumbnail when they return to the page as my app is part of a registration system allowing them to switch back and forth across screens.
     
    I cannot see anyway of hooking into useful events to allow
    (a) raising an event to show the newly uploaded image,
    (b) a way of hooking into the remove function so that I can also remove my additionally saved ".jpg" image
     
    Any ideas??
     
    Thanks in advance
  •  12-29-2009, 2:04 PM 57968 in reply to 57965

    Re: AjaxUploader Thumbnail image

    Dear greyhound,
     

    You can do this in event FileUploaded
     
         <CuteWebUI:UploadAttachments ID="attachment1" runat="server" OnFileUploaded="attachment1_FileUploaded" TempDirectory="~/haha">
            </CuteWebUI:UploadAttachments>

        protected void attachment1_FileUploaded(object sender, UploaderEventArgs args)
        {
             //save upload file to another folder
             //you can change the upload file name here, like args.CopyTo("~/savefolder/"+"myname.jpg");
            args.CopyTo("~/savefolder/"+args.FileName);
             //delete the tem files in folder C:\\Temp
            args.Delete();
        }
     
    Regards,
    Eric
View as RSS news feed in XML