Skip to content

Conversation

@yacman
Copy link

@yacman yacman commented Sep 17, 2014

Returning the key is important, when a filename contains Spaces or
other non-url safe characters the ‘Location’ parameter has encoded
them. When this happens, it’s impossible to use the ‘url’ as the key
when referencing the file via the AWS SDK as a bucket object.

e.g. I upload a file called ‘I have spaces.txt’. The ‘Location’ in
AWS’s response is ‘https://[bucket].s3.amazonaws.com/I+have+spaces.txt'
If we try to use this url to determine the key, URI.decode leaves the
+’s in there. The +’s could have been part of the original filename
‘I+have+spaces.txt’.

There’s no good way to clean the filename before hand, so, this really
needs to return the key back to the callback url along with the
url/location.

It's important to provide the content unchanged so that it can be referenced via the API.

Nate Yaconis added 2 commits September 17, 2014 15:18
Returning the key is important, when a filename contains Spaces or
other non-url safe characters the ‘Location’ parameter has encoded
them.  When this happens, it’s impossible to use the ‘url’ as the key
when referencing the file via the AWS SDK as a bucket object.

e.g. I upload a file called ‘I have spaces.txt’.  The ‘Location’ in
AWS’s response is ‘https://[bucket].s3.amazonaws.com/I+have+spaces.txt'
If we try to use this url to determine the key, URI.decode leaves the
+’s in there.  The +’s could have been part of the original filename
‘I+have+strings.txt’.

There’s no good way to clean the filename before hand, so, this really
needs to return the key back to the callback url along with the
url/location.
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.

1 participant