We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Elixir version (elixir -v): 1.9.2
Waffle version (mix deps): 1.1.3
Waffle dependencies when applicable (mix deps): waffle_ecto ~> 0.0.9 ex_aws ~> 2.1.2 ex_aws_s3 ~> 2.0
Operating system: Linux
When I specify a custom filename
def filename(version, {file, scope}) do UUID.generate() end
and generate a presigned url like so
Uploader.url({ MY_FILE_NAME })
The signed URL should be consistent
The signed URL generates a new random UUID each time
Run 1: Uploader.url({ MY_FILE_NAME }, signed: true)
%{ original: "http://localhost:9000/images/uploads/[d7bce6fe-3180-414d-b502-d453f6ff9a59.jpeg?63786439354]?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20210423%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210423T232731Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=952864201db87b55f82b9cf1fab2ce1fa4915c90f62fd1fb5ca7430b54a0dd1f" }
Run 2: Uploader.url({ MY_FILE_NAME }, signed: true)
%{ original: "http://localhost:9000/images/uploads/[c1734afe-0774-4e4e-b8f9-0a3859c08ae6.jpeg?63786439354]?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minio%2F20210423%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210423T232730Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=dd186a15e725b2f24e6a6398fc05d9f496020b4d2d493bf82852f5c035ab2cee" }
Stuff in square brackets is to highlight the issue. Same filename, different URLs each time, this causes the storage to return "no such key" error.
The text was updated successfully, but these errors were encountered:
Waffle does not support dynamic file naming. So basically when you are trying to get file back, it just call filename/2
filename/2
I'm struggling with this issue now to, as I want to have multiple files in one schema, but files that have same names will be rewritten on upload
Sorry, something went wrong.
Well that seems like a massive oversight because that makes presigned URLs practically impossible to use.
yeah, seems like an issue we could improve upon
btw, you can use "scope", to extract the current filename if it's exists, this should work for your case
No branches or pull requests
Environment
Elixir version (elixir -v):
1.9.2
Waffle version (mix deps):
1.1.3
Waffle dependencies when applicable (mix deps):
waffle_ecto ~> 0.0.9
ex_aws ~> 2.1.2
ex_aws_s3 ~> 2.0
Operating system:
Linux
Expected behavior
When I specify a custom filename
and generate a presigned url like so
The signed URL should be consistent
Actual behavior
The signed URL generates a new random UUID each time
Run 1:
Uploader.url({ MY_FILE_NAME }, signed: true)
Run 2:
Uploader.url({ MY_FILE_NAME }, signed: true)
Stuff in square brackets is to highlight the issue. Same filename, different URLs each time, this causes the storage to return "no such key" error.
The text was updated successfully, but these errors were encountered: