-
Notifications
You must be signed in to change notification settings - Fork 53
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
Conversation
There was a problem hiding this 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 ]; |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
There was a problem hiding this comment.
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 ]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be removed?
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
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.
Do you want to push your changes? :) |
Done! |
Thank you! |
This PR adds the following functions:
createMultipartUpload
putPart
completeMultipartUpload
generatePresignedURLForPart
Which allow for multipart uploads