How to save image into database

6 posts, 0 answers
  1. Ravi Kumar
    Ravi Kumar avatar
    37 posts
    Member since:
    May 2010

    Posted 09 Jul 2010 Link to this post

    Hi,

    How to save image into database on button click using RadAysncUpload control.

    Please Help!

    Regards
    Ravi
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 14 Jul 2010 Link to this post

    Hi Ravi Kumar,

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anahi
    Anahi avatar
    2 posts
    Member since:
    Jan 2011

    Posted 18 Feb 2011 Link to this post

    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


    =)
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 23 Feb 2011 Link to this post

    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:
    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!
  6. Navnit
    Navnit avatar
    19 posts
    Member since:
    Jan 2011

    Posted 10 Mar 2011 Link to this post

    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
  7. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 14 Mar 2011 Link to this post

    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
    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!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017