How to upload pdf to S3 bucket? - amazon-s3

I recorded jmeter script with blazemeter to upload a pdf file to the s3 bucket.When I parameterize the required values and execute the script to upload the file I am getting the error response
Response code: 403
Response message: Forbidden
All the parameters have correct values passed.

You should also get an appropriate Error Code which provides way more information regarding what's wrong, i.e. Access Denied or All access to this Amazon S3 resource has been disabled., once you know the root cause you should be able to figure out what needs to be done in order to resolve the issue.
Also double check all the request parameters using Debug Sampler and View Results Tree listener, for example you cannot record and replay X-Amz-Signature, you need to generate a proper one for each and every request, see How to Handle Dynamic AWS SigV4 in JMeter for API Testing article for more details

Related

Aws S3 bucket (AccessDenied) on LS through cli but not through CDN

When attempting to execute ls through the aws cli I am getting the following error:
An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied
However, through the browser (doing just a GET request):
<ListBucketResult>
<Name>static.example.com</Name>
<Prefix/>
<Marker/>
<MaxKeys>1000</MaxKeys>
<IsTruncated>true</IsTruncated>
<Contents>
I know that:
The static page is setup behind cloudflare
The static page is setup as a subdomain
With this in mind, is aws cli getting (AccessDenied) because the s3 bucket is behind CloudFlare? Should i be able to ls its contents if it's doable through a web browser? If so, is there any way to debug it to see the response that's being received by the server?
Additionally, I see that the response is truncated. Can I somehow get more than 1000 items accessing it via the subdomain? I have already tried adding ?marker=1000 to the endpoint, however it reflects the marker on the response, but lists the same files as if no marker parameter was provided.

Parameter validation failed:\nInvalid bucket name \"\": Bucket name must match the regex [JMeter]

When I try to make a post request using JMeter to S3 bucket AWS, I get the above-mentioned error message. My body of the request does not contain "backslash" and also my bucket name does not contain "backslash". Not sure why am getting this issue. Can someone please help me resolve this issue?
Http Request:
HTTP Header Manager
ViewResultTree Output:
This is an AWS validation error for S3. Mind following this thread?
ERROR: Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$"

Azure File Storage the server responded with a status of 400 (Condition headers are not supported.)

I have some png files stored in Azure file Storage, and I'm retrieving and displaying it from my MVC web project to the browser. But sometimes I get the below error message from browser console.
Failed to load resource: the server responded with a status of 400
(Condition headers are not supported.)
If I refresh the page again, the error message disappears automatically. But it doesn't solve my problem as I run my MVC project again, the same error comes back. How to solve it?
It's acutally a common issue on Azure Storage, which be listed in the offical reference Common REST API Error Codes as the figure below.
It means that Get File REST API does not support those request headers which not be listed in the Request Headers.
There is a similar SO thread Azure File Storage Error: Condition Headers Are Not Supported, which got the same issue with yours. It seems to show up different behavior in different browses when you get a file from Azure File Storage.
I could not reproduce this issus by a file url with SAS token, but I really recommend that you need to store these static files like images on Azure Blob Storage, as I known and as Azure best practice, to show an image by its url with sas token or a public container.

Sending text file to Jenkins via remote trigger - from excel (VBA)

I have a job in Jenkins that accepts a text file parameter.
Builds are triggered from an excel macro - and I'm having difficulty understanding how to send the file to Jenkins.
Up until now, what I understood is the following:
the file must be sent in an HTTP POST request, in the body.
the file must be sent in multipart/form-data format.
What I can't seem to manage to find out:
how exactly do I encode my file to multipart/form-data in VBA?
how do I send multiple files to Jenkins in the same HTTP POST request?
More information that might be helpful:
I'm using MSXML2.XMLHTTP60.
The job has other parameters (string, password), so I'm using the format:
http://server/job/myjob/buildWithParameters?PARAM1=Value1&PARAM2=Value2
Thank you in advance for any help.
EDIT:
After a lot of headeache, I discovered that currently, the option of sending a file parameter via an http POST request is not supported:
https://issues.jenkins-ci.org/browse/JENKINS-56169
But it has been opened as a new feature request.
The only option is pretending to be the web browser, and sending an http POST request identical to the one the Jenkins server is expecting to receive.
This poses the problem I described in the Jenkins Issue - the server's response doesn't contain the item's location in the queue.

how to Bypass cross origin call editor.swagger.io in documentation of API

While running the yaml file in editor i am getting this message:
"This is a cross-origin call. Make sure the server at sitedomain.com accepts GET requests from editor.swagger.io."
Is there any alternate way to get response directly not through editor,swagger.io. thanks in advance.