I use stream for file with: memory stream, stream readinng or file stream such as
byte[] buff = System.IO.File.ReadAllBytes(open.FileName);
System.IO.MemoryStream ms = new System.IO.MemoryStream(buff);
and I want to send it to blob storage and at that point my blob is empty, is it because of reading file by stream or it refers to other problem such as miss configuration on blob or CloudStorageAccount connection string.
Just use the below code. No need to convert memory stream, You can pass stream to blob storage using Blob.UploadfromStream method.
Please ensure that your stream is positioned at
0
just before you start uploading to blob from that stream. As mentioned in the comments above, you could try the following:or