Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: cfhttp post to AWS S3 works in CF9 but fails in CF10

$
0
0

Thanks for the replies. I used cfdump to examine the results, but other than a custom 500 error page, I didn't see anything out of the ordinary.

 

Using CF's built-in S3 capabilities may work. I haven't used it before and so I was just following the steps provided in Canvas's documentation. I am not positive how to use the data returned from the initial Canvas API call to form the S3 request. I tried the following:

 

<cffile

    action="write"

    output="S3 Specifications"     file="s3://#jsonData.upload_params.AWSAccessKeyId#:#jsonData.upload_p arams.policy#@#Replace(jsonData.upload_url,'https://','','ALL')##jsonData.upload_params.key#"/>

 

Assuming that the returned policy value (a 545-character random string) is the secrect key and that the upload_params_key should be appended to the bucket location (it looks approximately like this: account_XXXXX/attachments/XXXXXXXX/XXXXXXXXXX.jpg). I was getting a SignatureDoesNotMatch error from that request.

 

Additionally, I tried sending the requests to a basic web server that should capture the request data and write them to a file. It doesn't look like it worked like I expected it to--I'm not sure why neither instance includes all the data--but here are the results in case they are relevant:

 

CF9:

POST / HTTP/1.1

Host: osric.com:50000

Connection: close, TE

TE: trailers, deflate, gzip, compress

User-Agent: ColdFusion

Accept-Encoding: deflate, gzip, x-gzip, compress, x-compress

Content-type: multipart/form-data; boundary=-----------------------------7d0d117230764

Content-length: 6289

 

CF10:

POST / HTTP/1.1

User-Agent: ColdFusion

Content-Type: multipart/form-data; boundary=-----------------------------7d0d117230764

Connection: close

Content-Length: 6289

Host: osric.com:50000

 

-------------------------------7d0d117230764

Content-Disposition: form-data; name="key"

Content-Type: text/plain; charset=UTF-8

 

account_XXXXX/attachments/XXXXXXXX/XXXXXXXXX.jpg

-------------------------------7d0d117230764

Content-Disposition: form-data; name="acl"

Content-Type: text/plain; charset=UTF-8

 

private

-------------------------------7d0d117230764

Content-Disposition: form-data; name="Filename"

Content-Type: text/plain; charset=UTF-8

 

XXXXXXXXX.jpg

-------------------------------7d0d117230764

Content-Disposition: form-data; name="AWSAccessKeyId"

Content-Type: text/plain; charset=UTF-8

 

XXXXXXXXXXXXXXXXXXXXXX

-------------------------------7d0d117230764

Content-Disposition: form-data; name="Policy"

Content-Type: text/plain; charset=UTF-8

 

XXXXXXXXXXXXXXXXXXXXX[...lots of characters...]XXXXX

-------------------------------7d0d117230764

Content-Disposition: form-data; name="Signature"

Content-Type: text/plain; charset=UTF-


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>