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

Keep the filename of the original file #277

Open
GitBoudewijn opened this issue Mar 20, 2021 · 1 comment
Open

Keep the filename of the original file #277

GitBoudewijn opened this issue Mar 20, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@GitBoudewijn
Copy link

GitBoudewijn commented Mar 20, 2021

Right now you can use &filename= to set the filename for an image but otherwise it's always image.jpg/image.webp etc.

It would be nice if by default it would just keep the filename from the Content-Disposition header of the original file. (Changing the extension depending on &output=.)

If the original location doesn't have a Content-Disposition header you could just set the filename based on the last part of the url. (The same as the browser would name it automatically if you download it from the original location.)

So images.weserv.nl/?url=example.com/a/xxx.jpg&output=webp the filename would become xxx.webp.

You could then use &filename= to overwrite the original filename.

@andrieslouw andrieslouw self-assigned this Jul 4, 2021
@andrieslouw andrieslouw added the enhancement New feature or request label Jul 4, 2021
@andrieslouw
Copy link
Member

Will need to take a look at this, as it has some security implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants