Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Re: upload image
upload image
Last post 08-13-2009, 5:51 AM by
bit20
. 4 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
08-11-2009, 11:02 PM
54637
bit20
Joined on 08-12-2009
Posts 4
upload image
Reply
Quote
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
cutechat
Joined on 07-22-2004
Posts 2,332
Re: upload image
Reply
Quote
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
bit20
Joined on 08-12-2009
Posts 4
Re: upload image
Reply
Quote
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
cutechat
Joined on 07-22-2004
Posts 2,332
Re: upload image
Reply
Quote
Hi,
please try this :(attach the event at first)
void
Uploader_FileUploaded(
object
sender, UploaderEventArgs args)
{
string
targetpath = Server.MapPath(
"~/MyDir/"
+ args.FileName);
args.MoveTo(targetpath);
}
Regards,
Terry
08-13-2009, 5:51 AM
54665
in reply to
54654
bit20
Joined on 08-12-2009
Posts 4
Re: upload image
Reply
Quote
when i fire this event (
FileUploaded
) it embaded with the
Default.aspx
page but i want to place it in
Default.cs
page