parse-community / parse-community/parse-server-s3-adapter
Improve URL encoding in createFile() Location field
@mtrezza is already working on this.
Since Feb 21, 2026.
- Dominant language
- JavaScript
- Stars
- 80
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
Background
The Location field returned by createFile() in index.js currently uses raw params.Key without URL encoding. This is pre-existing behavior that should be improved to properly handle filenames with special characters (e.g., spaces, parentheses).
Problem
Filenames with spaces or special characters (e.g., my file (1).txt) produce technically malformed URLs in the Location field:
- Current:
https://bucket.s3.region.amazonaws.com/my file (1).txt - Expected:
https://bucket.s3.region.amazonaws.com/my%20file%20(1).txt
Solution
Apply proper URL encoding to params.Key when constructing the Location URL, using:
params.Key.split('/').map(encodeURIComponent).join('/')
This matches the logic already used in getFileLocation() and avoids encoding path separators.
References
- PR #459
- Comment: https://github.com/parse-community/parse-server-s3-adapter/pull/459#discussion_r2835761821
- Identified by: @mtrezza
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.