-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
mod_xsendfile serving files with url-encoded names #85
Comments
And I am not an expert of xsendfile... But let's try to find what's going wrong ;) If I understood correctly, in your client, you request a dowload of Just to be sure, does your setup work fine with full-ascii filenames? It looks like the anomaly is in the That said, at the moment I do not know what is the cause of the anomaly above... I think we could check 2 things:
(note: I cannot promise I will investigate today...) |
>>> from django_downloadview import response
>>> response.content_disposition('[[email protected]:22]-[2067].zip')
"attachment; filename=[[email protected]:22]-[2067].zip; filename*=UTF-8''%5Bpbs%2Bssh%40example.com%3A22%5D-%5B2067%5D.zip" If django_downloadview is given not-urlencoded filename, it should return the content-disposition as shown above. Another thing that could happen is: django_downloadview returns the content-disposition above, and xsendfile urlencodes it again before sending it to the client. |
Thank you for answering so soon.
Yes.
Yes (for the file name, please see below).
>>> from django_downloadview import response
>>> response.content_disposition('[[email protected]:22]-[2067].zip')
"attachment; filename=[[email protected]:22]-[2067].zip; filename*=UTF-8''%5Bpbs%2Bssh%40example.com%3A22%5D-%5B2067%5D.zip"
I was getting the same response even after restarting httpd with
so... perhaps my original assumption (that xsendfile pre-1.0 doesn't url-decode) was right after all ??? Because the file is there for sure. EDIT: I tried again with xsendfile 1.0. It serves the file with the correct size but still the wrong name. |
Sorry, I closed it by mistake. |
Think I've found where the double encode is happening. FileSystemStorage's url() method escapes the filename with |
#135 Will this fix this issue? |
Hello,
This is my first time using both xsendfile and downloadview so I might be doing something wrong. I apologize if that is the case.
So I'm trying to serve files with a non ascii characters and getting the file names all messed up.
My
httpd.conf
:settings.py
:The view:
I've been reading the changelogs from both downloadview an mod_xsenfile and it appears that downloadview might have been upgraded too soon ???Below is the last update of xsendfile which is still on beta and not available in the repositories of Ubuntu or Fedora.
So, if I understand correctly, previous versions don't url-decode the file names...
EDIT: Just tried with xsendfile 1.0 built from source and still have the problem so... I have no idea
of what is happening...
Response headers:
Do you know how I could fix this?
Many thanks,
Adrian
The text was updated successfully, but these errors were encountered: