
Ravi Kumar
Top achievements
Rank 1
Ravi Kumar
asked on 09 Jul 2010, 12:58 PM
Hi,
How to save image into database on button click using RadAysncUpload control.
Please Help!
Regards
Ravi
How to save image into database on button click using RadAysncUpload control.
Please Help!
Regards
Ravi
5 Answers, 1 is accepted
0
Hi Ravi Kumar,
Please check our new online example which demonstrates this functionality.
Greetings,
Yana
the Telerik team
Please check our new online example which demonstrates this functionality.
Greetings,
Yana
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

Anahi
Top achievements
Rank 1
answered on 18 Feb 2011, 07:15 PM
Hi! i have a question...
As I can add the event Asyncupload _Fileupload in the event of the button? and save into database with others Radtextbox
=)
As I can add the event Asyncupload _Fileupload in the event of the button? and save into database with others Radtextbox
=)
0
Hi Ravi,
I'm not quite sure what you mean by "add the event Asyncupload _Fileupload in the event of the button".
This event is fired for every uploaded file , which is about to be saved in the Target Folder, and in order to fire this event a post-back should occur. In the demo , which my colleague has pointed you to, there is no Target Folder , but the file is directly saved into database by extending the Handler and providing custom implementation. In general you could save your image along with other data using OnFileUploaded event , without implementing the case from the demo. You just subscribe on the above mention server event, and when you click a button which cause a post-back this event will be fired. When the event is fired you should get reference to the uploaded file:
and then you could save it manually to the desired database. In this event you could also get reference to other controls like RadTextBox , but be aware that this event is fired for every file uploaded. So if you allow multiple file uploading you may end with data duplication, if you save data from other controls each time
event is fired.
I hope this would help you.
Best wishes,
Dimitar Terziev
the Telerik team
I'm not quite sure what you mean by "add the event Asyncupload _Fileupload in the event of the button".
This event is fired for every uploaded file , which is about to be saved in the Target Folder, and in order to fire this event a post-back should occur. In the demo , which my colleague has pointed you to, there is no Target Folder , but the file is directly saved into database by extending the Handler and providing custom implementation. In general you could save your image along with other data using OnFileUploaded event , without implementing the case from the demo. You just subscribe on the above mention server event, and when you click a button which cause a post-back this event will be fired. When the event is fired you should get reference to the uploaded file:
protected
void
OnFileUploaded(
object
sender, FileUploadedEventArgs args)
{
UploadedFile file = args.File;
}
and then you could save it manually to the desired database. In this event you could also get reference to other controls like RadTextBox , but be aware that this event is fired for every file uploaded. So if you allow multiple file uploading you may end with data duplication, if you save data from other controls each time
event is fired.
I hope this would help you.
Best wishes,
Dimitar Terziev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0

Navnit
Top achievements
Rank 2
answered on 10 Mar 2011, 04:55 PM
Hi Telerik,
How do you actually save files to the database when the OnClientFileUploaded() event is fired. I am fully aware of the OnFileUploaded() server-side event but I actually do not want to use it because I am also plugging a RadProgressArea along with it. Eventually, this results in the RadProgressArea to be shown twice (1st time while adding the files to the RadAsyncUpload control and the 2nd time when the upload button is actually clicked).
Basically, what I want to achieve is to save the files directly to the database and showing the RadProgressArea while getting rid of the Upload Button.
Cheers
How do you actually save files to the database when the OnClientFileUploaded() event is fired. I am fully aware of the OnFileUploaded() server-side event but I actually do not want to use it because I am also plugging a RadProgressArea along with it. Eventually, this results in the RadProgressArea to be shown twice (1st time while adding the files to the RadAsyncUpload control and the 2nd time when the upload button is actually clicked).
Basically, what I want to achieve is to save the files directly to the database and showing the RadProgressArea while getting rid of the Upload Button.
Cheers
0
Hi Navnit,
If you don't want to have a button, which triggers a post-back, you should check the online example, my colleague Yana has suggested before. Just in case you have missed it, you could check it here, along with this help article here.
Basically you should extend the RadAsynUpload handler to provide your custom functionality as described and shown in the demo.
Greetings,
Dimitar Terziev
the Telerik team
If you don't want to have a button, which triggers a post-back, you should check the online example, my colleague Yana has suggested before. Just in case you have missed it, you could check it here, along with this help article here.
Basically you should extend the RadAsynUpload handler to provide your custom functionality as described and shown in the demo.
Greetings,
Dimitar Terziev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!