Open
Description
New Issue Checklist
- Report security issues confidentially.
- Any contribution is under this license.
- Before posting search existing issues.
Issue Description
File adapters cannot set file location during file creation if file name will be changed during file creation. This issue has specific effects on the s3 file adapter, but may apply to any specific file adapter for the platform.
Steps to reproduce
- Using s3 file adapter, enable generateKey for filenames (such as (filename) =>
${Date.now()}_${filename}
) - (optional) disable preserveFileName
- Upload/ Create a file via a client application
Actual Outcome
- File "Image.jpeg" will be uploaded to S3 via the desired key "/TODAY_Image.jpeg" (or prepended with a hex string if preserveFileName is disabled eg: "/ABCDEF123_TODAY_Image.jpeg)
- File location will be returned and stored as "s3://ABCDEF123_Image.jpeg" and filename will be returned as "ABCDEF123_Image.jpeg"
Expected Outcome
- File "Image.jpeg" will be uploaded and filename will be modified as desired
- File Location and filename will reflect changes made during createFile
Environment
~parse-server 8.0.0-alpha.6 (but should be identical on 7.3)
~@parse/s3-files-adapter 4 (but should be identical for 4)
Server
- Parse Server version:
8.0.0-alpha.6
- Operating system:
OSX
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Local and Heroku
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
7
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
MongoDB Atlas
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
JavaScript
- SDK version:
Unkown
Code in question is here