Store file name in my database and display the image uploaded in DataForm

4 posts, 0 answers
  1. Louis Bouchard
    Louis Bouchard avatar
    94 posts
    Member since:
    Feb 2010

    Posted 03 Jun 2010 Link to this post

    Hello,

    A bit thank you to Telerik about this amazing Upload Control.  Very nice job and very easy to use!  Congradulations folks!!!

    I got 2 questions now.  I use the Upload control in a DataForm and I want this :

    1) Change the name of the file (it's images) uploaded and store it in a text field in my DataForm.
    2) Display the image uploaded (server side) in my DataForm.

    Any suggestion will be VERY appreciate.

    Thanks for all.
  2. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 08 Jun 2010 Link to this post

    Hi Louis Bouchard,

    I attached a sample project which shows you an approach to your issue. Review it and tell me if it works for you.

    Sincerely yours,
    Viktor Tsvetkov
    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. DevCraft banner
  4. Louis Bouchard
    Louis Bouchard avatar
    94 posts
    Member since:
    Feb 2010

    Posted 08 Jun 2010 Link to this post

    Thank you Viktor,

    Where come from the DataItem?

    For now, I use this code :

     

    private void RadUpload1_FileUploaded(object sender, Telerik.Windows.Controls.FileUploadedEventArgs e)

     

    {

    ((

    TextBox)DataFormfiches.FindNameInContent("TextBoxPhoto")).Text = e.SelectedFile.Name;

     

    // Take the photo on server
    PictureService.

    PictureServiceClient client = new BusinessApplicationTest.PictureService.PictureServiceClient();

     

    client.DownloadCompleted +=

    new EventHandler<BusinessApplicationTest.PictureService.DownloadCompletedEventArgs>(client_DownloadCompleted);

     

    client.DownloadAsync(((

    TextBox)DataFormfiches.FindNameInContent("TextBoxPhoto")).Text);

     

    }

  5. Viktor Tsvetkov
    Admin
    Viktor Tsvetkov avatar
    382 posts

    Posted 14 Jun 2010 Link to this post

    Hello Louis Bouchard,

    DataItem is the business object that helps you to make the databinding. Could you please send me your whole sample project so I will easier make the requested changes.

    Regards,
    Viktor Tsvetkov
    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.
Back to Top