-
-
Couldn't load subscription status.
- Fork 55
Open
Description
In documentation:
- examples for X-Sendfile are not clear (include directive references wrong code)
- what URL middlewares catches and what URL it passes as X-Senfile header should be explained.
As an example:
- given
settings.MEDIA_URL = '/media/' - given a model with
file = models.FileField(upload_to='documents'). It will havefile.urlprefixed with MEDIA_URL and UPLOAD_TO, i.e./media/documents/in our example. - given
source_urlis"/media/documents/", middleware will catch DownloadResponse where file.url starts with"/media/documents/", such as"/media/documents/sample-filename.pdf"=> middleware will send "/sample-filename.pdf" to x-sendfile - given
destination_urlis"/var/lib/media/documents"(notice no trailing backslash) => x-sendfile value will be/var/lib/media/documents/sample-filename.txt - in general,
destination_urlshould match one value configured asXSendFilePathin Apache configuration.
Metadata
Metadata
Assignees
Labels
No labels