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

Issue with space in filename #196

Closed
utricularian opened this issue Jul 31, 2013 · 0 comments
Closed

Issue with space in filename #196

utricularian opened this issue Jul 31, 2013 · 0 comments

Comments

@utricularian
Copy link

I tried something equivalent to

client.putStream readableStream, "Path/With/Some spaces in it.ext", headers, callback

Two things would happen:

  1. The PUT wouldn't actually put anything
  2. The callback would be called with no error and the response would look totally valid.

I changed client.js' encodeSpecialCharacters to include a single space in the regex and now it works fine and dandy.

OLD:

function encodeSpecialCharacters(filename) {
  // Note: these characters are valid in URIs, but S3 does not like them for
  // some reason.
  return filename.replace(/[!'()*]/g, function (char) {
    return '%' + char.charCodeAt(0).toString(16);
  });
}

NEW:

function encodeSpecialCharacters(filename) {
  // Note: these characters are valid in URIs, but S3 does not like them for
  // some reason.
  return filename.replace(/[!'()* ]/g, function (char) {
    return '%' + char.charCodeAt(0).toString(16);
  });
}
@domenic domenic closed this as completed in c376c0d Aug 1, 2013
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

No branches or pull requests

1 participant