How to get a byte array from the uploaded file?

  •  04-16-2009, 9:06 AM

    How to get a byte array from the uploaded file?

    CuteWebUI.MvcUploadFile file = uploader.GetUploadedFile(fileguid);
     
    if (file != null)
    {
     
    // instead of moving the file to a temp-folder, how can I get access to the bytes, like:
    // byte[] theFile = new byte[file.ContentLength];
    // theFile = file.ToArray();

    file.MoveTo("~/UploaderTemp/" + file.FileName);

    processedfiles.Add(file.FileName);

    }

    Filed under:
View Complete Thread