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

Thread is closed for posting
2 posts, 0 answers
  1. Greg
    Greg avatar
    1 posts
    Member since:
    May 2008

    Posted 07 Aug 2008 Link to this post

    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'
  2. Donna
    Donna avatar
    3 posts
    Member since:
    Jul 2008

    Posted 15 Sep 2008 Link to this post

    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.
Back to Top