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

Inputstream - Argument '3': cannot convert from 'long' to 'int'

1 Answer 119 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 07 Aug 2008, 03:24 PM
Here's the example I am following:

foreach
(UploadedFile file in RadUpload1.UploadedFiles)
  {
      
byte[] bytes = new byte[file.InputStream.Length];
      file.InputStream.Read(bytes, 0, file.InputStream.Length);
  }

However, I am getting an error: Argument '3': cannot convert from 'long' to 'int'

1 Answer, 1 is accepted

Sort by
0
Donna
Top achievements
Rank 1
answered on 15 Sep 2008, 09:21 PM
Hi,

I had the same problem - I got the example code from one of the samples on this site. You need to change the following line:

file.InputStream.Read(bytes, 0, file.InputStream.Length);

to

file.InputStream.Read(bytes, 0, file.ContentLength);

Hope this helps.
Tags
Upload (Obsolete)
Asked by
Greg
Top achievements
Rank 1
Answers by
Donna
Top achievements
Rank 1
Share this question
or