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

S3 filename generated by generateKey option is ignored by Parse Server #87

Open
mman opened this issue Mar 18, 2020 · 2 comments
Open

Comments

@mman
Copy link

mman commented Mar 18, 2020

If you use the generateKey to customize a filename before uploading a file to S3, the newly generated filename is then ignored and not properly propagated back to the Parse Server to be stored in the fields referencing that file.

The only way to make the generateKey option work is to turn on ParseServer preserveFilenames option that will leave all the logic of generating proper file names on the client.

See parse-community/parse-server#6518

The proposal would be to modify validateFilename in file adapters to not return error but rather a modified filename. That can in turn reuse the generateKey option.

@mman
Copy link
Author

mman commented Mar 18, 2020

https://github.com/parse-community/parse-server-s3-adapter/blob/master/index.js#L113 will have response.Key contain the real filename uploaded to S3. There is currently no way to propagate that officially to the Parse Sever.

@mman
Copy link
Author

mman commented Apr 3, 2020

Once Parse Server 4.2 with support for file triggers is out, I propose to retire the generateKey option to S3 adapter entirely since it is broken anyway. Thoughts?

parse-community/parse-server#6344

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