CURLSMBS.OpenMTInputFile(f) not UpLoading to AWS

My Desktop app used to use CURLSMBS.InputData to send local files to my AWS bucket. This has worked well until I have found it balks at large files (I tried a 2.3 GB video file):

newPathName = "/" + AWSBucketName + "/" + serverFolderName + "/" + userFolderName + "/" + f.Name
myCURLSMBS = New classCURLSMBS
myCURLSMBS.OptionVerbose = False
myCURLSMBS.OptionUpload = True
myCURLSMBS.InputData = myBinaryStream.Read(f.Length)
myBinaryStream.Close
Call myCURLSMBS.SetupAWS(AWSAccessKeyID, AWSSecretAccessKey, AWSRegion, AWSService, newPathName, AWSDomain, "PUT")
returnValue = myCURLSMBS.PerformMT
…

So today I am instead trying OpenMTInputFile with everything else identical:

newPathName = "/" + AWSBucketName + "/" + serverFolderName + "/" + userFolderName + "/" + f.Name
myCURLSMBS = New classCURLSMBS
myCURLSMBS.OptionVerbose = False
myCURLSMBS.OptionUpload = True
if not myCURLSMBS.OpenMTInputFile(f) then
  Return "Unable to open file stream"
end if
Call myCURLSMBS.SetupAWS(AWSAccessKeyID, AWSSecretAccessKey, AWSRegion, AWSService, newPathName, AWSDomain, "PUT")
returnValue = myCURLSMBS.PerformMT
myCURLSMBS.CloseMTInputFile
…

Both methods show the progress of the file being sent to the AWS server, run the Finished event and return a zero result, but in the second case (even with a tiny file) no file appears in the AWS anywhere at all! I have tried with both Perform and PerformMT, but still no file at all.

  1. Is there a limit to the file size of CURLSMBS.InputData?
  2. Should CURLSMBS.OpenMTInputFile be able to handle any size file?
  3. Where is CURLSMBS.OpenMTInputFile placing the uploaded file, if not in newPathName?

HashedPayload parameter must be lowercase SHA256 of the file.

So please use SHA512MBS class to make the hash of the file. Make sure it’s hex encoded and lowercase.

I have added:

tempString = SHA512MBS.Hash(myBinaryStream.Read(f.Length)) tempString = EncodingToHexMBS(tempString) tempString = tempString.Lowercase
then adjusted the call as:

Call myCURLSMBS.SetupAWS(AWSAccessKeyID, AWSSecretAccessKey, AWSRegion, AWSService, newPathName, AWSDomain, "PUT", tempString)

But still no file appears after uploading. Any other ideas? Is CURLSMBS.OpenMTInputFile really the best way to go?

Debug log? Test project?
You can email me later something.

The debug log had at the end

when I changed the code to

tempString = SHA256MBS.HashFile(f).Lowercase

the upload appeared OK. I’ll test it with larger files now. Thank you Christian.

Just confirming that I was able to upload and download a 2.3 GB file from AWS using CURLSMBS.OpenMTInputFile().

Excellent. Have fun!