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

FileBytes properties in RadUpload?

1 Answer 374 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ferdinand
Top achievements
Rank 1
Ferdinand asked on 23 Dec 2010, 09:25 AM
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
Ferdinand

1 Answer, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 23 Dec 2010, 02:20 PM
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.
Tags
Upload (Obsolete)
Asked by
Ferdinand
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or