I'm fairly new at working with streams, and I'm testing web app uploads to Amazon Web Services using the SDK APIs. An error is generated during this process that says the FileStream is null. I've tried using the Put instead of TransferUtility and read all of the AWS documentation, but uploads seem to only be explained from a path instead of from a web upload. Does anyone see why the FileStream is null and the save is not working? Thanks in advance!
using (var client = new AmazonS3Client(Amazon.RegionEndpoint.USWest1))
{
//Save File to Bucket
using (FileStream txtFileStream = UploadedFile.InputStream as FileStream)
{
try
{
TransferUtility fileTransferUtility = new TransferUtility();
fileTransferUtility.Upload(txtFileStream, bucketLocation, UploadedFile.FileName);
}
catch (Exception e)
{
e.Message.ToString();//txtFileStream is null!
}
}
}
UploadedFile.InputStream? - Jonesopolis