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

RadUpload in Ajaxified Grid

1 Answer 45 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Cécil
Top achievements
Rank 2
Cécil asked on 20 Nov 2008, 10:43 AM
Hi

I'd like to use the example of radupload in a Ajaxified Grid (http://demos.telerik.com/aspnet/prometheus/Controls/Examples/Integration/RadUploadInAjaxifiedGrid/DefaultCS.aspx?product=upload) but saving the images in a directory, and in the database save the path of these images.
How should I proceed?

1 Answer, 1 is accepted

Sort by
0
Blaize
Top achievements
Rank 1
answered on 20 Nov 2008, 02:51 PM
Hey C├ęcil,

How about:

string filePath = Path.Combine("C:\UploadedFiles", uploadedFile.GetName());
uploadedFile.SaveAs(filePath);
SqlConnection newConnection = new SqlConnection(myConnectionString);
SqlCommand newCommand = new SqlCommand(newConnection);
newCommand.Parameters.Add(new SqlParameter("filePath", filePath));
newCommand.ExecuteNonReader("insert into files(filePath) values (@filePath)");

Cheers,
Blaize
Tags
Upload (Obsolete)
Asked by
Cécil
Top achievements
Rank 2
Answers by
Blaize
Top achievements
Rank 1
Share this question
or