FileBytes properties in RadUpload?

Thread is closed for posting
2 posts, 0 answers
  1. Ferdinand
    Ferdinand avatar
    56 posts
    Member since:
    Jun 2008

    Posted 23 Dec 2010 Link to this post

    Hi there,
    is it possible to use the RadUpload like the ASP.NET FileUpload here (where fuDocument is the FileUpload):
    byte[] file = this.fuDocument.FileBytes;

    Best regards
  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 23 Dec 2010 Link to this post

    Hello Ferdinand,

    The RadUpload control does not work the same way as the standard ASP.NET FileUpload control. To read the uploaded file, it would look something like this:

    // get uploaded file
    UploadedFile attachment = upAttachment.UploadedFiles[0];
    // create byte array
    byte[] attachmentBytes = new byte[attachment.InputStream.Length];
    // read attachment into attachmentBytes
    attachment.InputStream.Read(attachmentBytes, 0, attachmentBytes.Length);

    I hope that helps.
Back to Top