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

Add Content-Disposition Header #104

Closed
wants to merge 1 commit into from
Closed

Add Content-Disposition Header #104

wants to merge 1 commit into from

Conversation

varbhat
Copy link
Contributor

@varbhat varbhat commented Oct 29, 2022

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

It helps Downloaders to detect Filename of the file.

@varbhat varbhat closed this by deleting the head repository Oct 29, 2022
@varbhat varbhat reopened this Oct 29, 2022
@anacrolix
Copy link
Owner

@varbhat maybe try something like https://github.com/anacrolix/confluence/blob/master/confluence/handlers.go#L39-L41, I've had to implement this many times, and it's a deep rabbit hole. Are you sure about attachment? I know it's part of the spec but can you operate without it? I wonder if some players will misinterpret it.

@varbhat
Copy link
Contributor Author

varbhat commented Nov 6, 2022

@anacrolix, I am using Download Navi App for Downloading. If attachment is not present, it doesn't resolve the filename :(

@anacrolix
Copy link
Owner

@varbhat that's fine, I just wanted to check. Can you use the linked to form and I'll merge.

@anacrolix
Copy link
Owner

@varbhat just following up, do you want to update this patch to quote the filename per the link (and retaining the attachment if that wasn't clear).

@varbhat
Copy link
Contributor Author

varbhat commented Mar 11, 2023

@anacrolix ,
I have been using my own fork with this commit (https://github.com/varbhat/dms/commit/cc3a1df8daaafec41fcbb47b6d52984f8aa473a9).

What should be changed? Should i update this PR to include implementation similar to that of confluence?

@anacrolix
Copy link
Owner

I think it needs to be something like w.Header().Set("Content-Disposition", "attachment; filename="+strconv.Quote(filename)).

@varbhat
Copy link
Contributor Author

varbhat commented Mar 13, 2023

@anacrolix #115

@varbhat varbhat closed this Mar 13, 2023
@anacrolix
Copy link
Owner

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants