UWP C++ S3 PutObject (upload file) error: Unable to parse ExceptionName: BadRequest Message: An error occurred when parsing the HTTP request.
0
Im trying to attach a function to upload a file directly to my bucket in s3 on my UWP's Application, bug im getting this errrorrrrrrrrrrr: Unable to parse ExceptionName: BadRequest Message: An error occurred when parsing the HTTP request.
Here's my S3 upload function code:
{
Aws::Client::ClientConfiguration config;
config.region = Aws::Region::SA_EAST_1;
Aws::S3::S3Client s3_client(credentials, config);
Aws::S3::Model::PutObjectRequest request;
request.SetBucket(bucketName);
request.SetKey(objectKey);
std::shared_ptr<Aws::IOStream> input_data =
Aws::MakeShared<Aws::FStream>("SampleAllocationTag",
objectName.c_str(),
std::ios_base::in | std::ios_base::binary);
request.SetBody(input_data);
Aws::S3::Model::PutObjectOutcome outcome =
s3_client.PutObject(request);
if (outcome.IsSuccess()) return true;
else
{
std::string sToConvert = outcome.GetError().GetMessage();
std::wstring w_str = std::wstring(sToConvert.begin(), sToConvert.end());
const wchar_t* w_chars = w_str.c_str();
Windows::UI::Popups::MessageDialog msg(ref new Platform::String(w_chars));
msg.Title = "Database Error";
msg.ShowAsync();
return false;
}
}
how can i fix this? :(
Topics
asked a year ago21 views
1 Answers
0
The problem was access to the file blocked by Windows security factors, to solve the problem of copying the file to the application folder and controlling the streams of that file.
answered a year ago
Relevant questions
Uploading greater than 6 MB file to S3 through API Gateway results in Request too long error, Is that expected ?
asked 3 months agoXlsx Upload - Failed to scan your file
Accepted Answerasked 4 months agoIAM role for S3 encrypted upload only
asked 3 years agoError: During file upload to S3 from Angular app
asked 3 years agoUWP C++ S3 PutObject (upload file) error: Unable to parse ExceptionName: BadRequest Message: An error occurred when parsing the HTTP request.
asked a year agoUpload to S3 from Lambda doesn't create file in bucket, no error
asked a year agoUpload error when uploading a new war file to an ELB instance.
asked 6 months agoAWS API Gatway to upload File To S3 without AWS Lambda
Accepted Answerasked a month agoTextract Error When PDF Is Uploaded to Folder
Accepted Answerasked 2 years agoUnable to upload file to bucket due to network error
Accepted Answerasked a year ago