This is a migrated thread and some comments may be shown as answers.

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

3 Answers 121 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Louis Bouchard
Top achievements
Rank 1
Louis Bouchard asked on 04 Jun 2010, 01:36 AM
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.

3 Answers, 1 is accepted

Sort by
0
Viktor Tsvetkov
Telerik team
answered on 08 Jun 2010, 03:41 PM
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.
0
Louis Bouchard
Top achievements
Rank 1
answered on 08 Jun 2010, 04:08 PM
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);

 

}

0
Viktor Tsvetkov
Telerik team
answered on 14 Jun 2010, 10:16 AM
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.
Tags
Upload
Asked by
Louis Bouchard
Top achievements
Rank 1
Answers by
Viktor Tsvetkov
Telerik team
Louis Bouchard
Top achievements
Rank 1
Share this question
or