Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

214
Views
Uploading to Amazon S3 using signed S3 url in Grails

Curl successfully uploads the file to S3 using a signed url:

curl -v -k -X PUT \
  -H "x-amz-server-side-encryption: AES256" \
  -H "Content-Type: application/pdf" \
  -T "__tests__/resources/test.pdf" \
  "http://mybucket.s3.amazonaws.com/test.pdf?AWSAccessKeyId=IDKEY&Expires=1489458783&Signature=SIGNATURE

I've tried replicating this in Grails using the REST client plugin:

  String url = "http://mybucket.s3.amazonaws.com/test.pdf?AWSAccessKeyId=IDKEY&Expires=1489458783&Signature=SIGNATURE"
  RestResponse resp = rest.put(url){
      header "x-amz-server-side-encryption", "AES256"
      header "Content-Type", "application/pdf"
      body pdf
  }

But Amazon rejects the upload, saying the arguments are incorrect...probably due to the pdf being sent as a "body" parameter. Any ideas?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Instead of using a rest client to upload it would be simpler to use the AWS Java SDK in your Grails app.

See an example here of using a pre-signed url to upload http://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObjectJavaSDK.html

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!