I have a file uploader
<SfUploader @ref="Uploader" ID="UploadFiles" AutoUpload=false MaxFileSize=104857600 AllowedExtensions=".wav">
<UploaderEvents ValueChange="OnChange" OnClear="OnClear" BeforeUpload="onBeforeUpload" Success="UploadedSuccuessfully"></UploaderEvents>
<UploaderTemplates>
Some stuff
</UploaderTemplates>
</SfUploader>
And my onchange event handler includes:
foreach (var file in args.Files)
{
Code to get vale of tempAudioFile
//Writes wav file to local disk for spectrograpgram production
FileStream filestream = new FileStream(tempAudioFile, FileMode.Create, FileAccess.Write);
file.Stream.WriteTo(filestream);
filestream.Close();
file.Stream.Close();
Code to upload file onto Azure blob storage, read & store wav file metadata and get spectrum of wav file just uploaded & upload to Azure blob storage
}
The uploaded wav files are often (usually) truncated, usually the files are more truncated if the internet speed is lower. It is almost as if I am doing an asynchronous upload and not doing a wait. The files are around 3 to 4MB in size so not huge.
What have I done wrong?