Hi all,
I’m trying to upload a file to AWS S3. S3 requires that the method used to upload the file be PUT, not POST. I don’t think the URL createOutputStream()
does PUT.
Here’s the code I have so far:
auto task = URL(uploadUrl).createOutputStream();
auto fileStream = File(file).createInputStream();
while (!fileStream->isExhausted())
{
task->writeByte(fileStream->readByte());
}
task->flush();
task
just returns empty
. Any ideas on how I can go about uploading the file?