upload image

Last post 08-13-2009, 5:51 AM by bit20. 4 replies.
Sort Posts: Previous Next
  •  08-11-2009, 11:02 PM 54637

    upload image

    i am using ajax uploader but when it upload an image to the directory it change the file name as persisted.646cd4da-6292-4bf4-b428-5fd4d142b9e1.question_mark_naught101_011.jpg.resx (original file name question_mark_naught101_011.jpg)
    i want to save the original file name with the uploaded image url to the database .
    how will i do it ????
    plz help me
  •  08-12-2009, 9:37 AM 54648 in reply to 54637

    Re: upload image

    Hi,
     
    This is file is a 'temporary' file which store the uploaded data.
     
    You need Move or Copy it to somewhere in the FileUploaded event
     
    and you can use the args.FileName to get the original file name.
     
    Regards,
    Terry
  •  08-12-2009, 10:00 AM 54649 in reply to 54648

    Re: upload image

    but how i can change the name from persisted.646cd4da-6292-4bf4-b428-5fd4d142b9e1.question_mark_naught.jpg.resx  to  question_mark_naught.jpg  & copy it to the othre directory
     
    & how i can write code in fileuploaded event in code behind (.cs page)
  •  08-12-2009, 11:12 AM 54654 in reply to 54649

    Re: upload image

    Hi,
     
    please try this :(attach the event at first)
    1. void Uploader_FileUploaded(object sender, UploaderEventArgs args)   
    2. {   
    3.     string targetpath = Server.MapPath("~/MyDir/" + args.FileName);   
    4.     args.MoveTo(targetpath);   
    5. }  

    Regards,
    Terry
  •  08-13-2009, 5:51 AM 54665 in reply to 54654

    Re: upload image

    when i fire this event (FileUploaded) it embaded with the Default.aspx page but i want to place it in Default.cs page
View as RSS news feed in XML