Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

see #63 adds multipart upload functions #64

Merged
merged 2 commits into from
Jul 22, 2022

Conversation

cybersonic
Copy link
Contributor

This PR adds the following functions:
createMultipartUpload
putPart
completeMultipartUpload
generatePresignedURLForPart

Which allow for multipart uploads

Copy link
Owner

@jcberquist jcberquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for this @cybersonic! I am really happy to be adding multipart upload support. I did have some cleanup requests if you have time. I'd like this in the library, so I am going to merge it in any case 😁

services/s3.cfc Outdated
for (
var key in arguments
) {
// if ( len( arguments[ key ] ) ) queryParams[ utils.parseKey( key ) ] = arguments[ key ];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it nothing from the arguments needs to go into the query string? Should this be removed then?

services/s3.cfc Outdated
'/#arguments.Key#',
queryParams,
{
// "x-amz-acl": "public-read"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! Will remove in my next PR!

services/s3.cfc Outdated

){
var requestSettings = api.resolveRequestSettings( argumentCollection = arguments );
dump("putPart");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Will do!

services/s3.cfc Outdated
for (
var key in arguments
) {
// if ( len( arguments[ key ] ) ) queryParams[ utils.parseKey( key ) ] = arguments[ key ];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as above, looks like this argument key loop isn't necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I had a copy pasta frenzy! removing!

services/s3.cfc Outdated
'/#arguments.Key#',
queryParams,
{
// "x-amz-acl": "public-read"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was debugging hard here :)

services/s3.cfc Outdated
);

if ( apiResponse.statusCode == 200 ) {
// apiResponse[ 'data' ] = utils.parseXmlDocument( apiResponse.rawData );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what the api response looks like here, is it an XML document? If not, can this 200 check be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should be XML for the most part.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in this case it just returns headers rather than any body content so I had to remove the XML Parsing

services/s3.cfc Outdated
"uploadId": arguments.UploadId
};
for (
var key in arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question again regarding the argument loop 😄

services/s3.cfc Outdated
);


if ( apiResponse.statusCode == 200 ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question regarding the response status check.

services/s3.cfc Outdated
required string Key,
required numeric partNumber,
required string uploadId,
// required string ContentType,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REmoved. I thought it was needed as part of the signing but apparently not.

@jcberquist
Copy link
Owner

Do you want to push your changes? :)

@cybersonic
Copy link
Contributor Author

Done!

@jcberquist jcberquist merged commit 458bf99 into jcberquist:master Jul 22, 2022
@jcberquist
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants