Save file in to folder by coding

Thread is closed for posting
2 posts, 0 answers
  1. Deepak
    Deepak avatar
    9 posts
    Member since:
    Aug 2010

    Posted 17 Jan 2011 Link to this post

    plz give me a small example how can i am save the file in the project folder by using radupload control through coding in c#.
    I have already using
    <telerik:RadUpload ID="imageUpload" runat="server" ControlObjectsVisibility="None"
                                            AllowedFileExtensions=".jpg,.jpeg,.png,.gif" TargetFolder="~/Record/">
    if (imageUpload.UploadedFiles.Count>0)
                      // Guid guid = new Guid();
                       string filename = Guid.NewGuid().ToString() +imageUpload.UploadedFiles[0].GetExtension();
                       testimonial.FileName = filename;
                       testimonial.FileUrl = "~/Record/" + filename;
                       filename = Server.MapPath("~/Record/" + filename);
                       testimonial.FilePhysicalPath = filename;
    But always imageUpload.UploadedFiles.Count property show 0 file upload .
    Please help me asps.
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 17 Jan 2011 Link to this post

    Hello Deepak,

    In your RadUpload control declaration, remove the TargetFolder property because I'm assuming the control is automatically saving the file, thus the reason why the UploadedFiles collection's length is 0.

    I hope that helps.
Back to Top