non-standard HTTP header supported by Apache to offload the process of serving large static files from dynamic scripts (eg: PHP, Python, Perl) after they have performed the necessary authorization or restriction logic.
Questions tagged [x-sendfile]
155 questions
2
votes
2 answers
Mod_XSendFile On a Mac
I've installed xsendfile on my mac and it is located in the apache modules. I've attempted to enable it via my htaccess file but I continually get an error. When I try to get a list of modules on my apache server via either terminal or php, it's not…

David
- 21
- 1
1
vote
1 answer
send_file and file permissions
My rails application (3.0.11) accesses the file system to download files that users have put onto the file system via SMB. Unfortunately, OS X Lion Server creates files via SMB with these permissions...
rwx --- --- user everyone
...but it does add…

Chris A.
- 183
- 11
1
vote
1 answer
Is there a way to tell if x-sendfile has started?
I think the subject says it all.
I want a download to start when a page is loaded and then for the body of the page to load once the script is sure the download has commenced.

Steve
- 1,371
- 1
- 16
- 38
1
vote
2 answers
XSendfile not working - PHP, Apache, Cpanel
I have been strongly recommended to use XSendfile since we are serving quite large files from our server. The server is running Cpanel. Previously we were using a straight force-download script, which also did not work well in some browsers. Hoping…

Edward Williams
- 307
- 1
- 7
- 18
1
vote
2 answers
Rails/Dragonfly/Apache - Rack::Cache - how to use X-Sendfile?
I'm using Dragonfly to serve processed images for my Rails app. Dragonfly relies on Rack::Cache for future visits to those processed images, so that Dragonfly won't have to process those images again and again, thus wasting CPU time.
My problem…

Ramon Tayag
- 15,224
- 9
- 43
- 69
1
vote
0 answers
Is it possible to use both XSendFile and mod_rewrite (with relative paths)?
I'm getting a puzzling error when using XSendFile and mod_rewrite.
XSendFile works properly when serving a file from a PHP script without a rewritten URL, but breaks causing a 404 error when a URL rewrite is happening.
To recreate the issue I've…

AdamM
- 11
- 2
1
vote
1 answer
Serve images using PHP not in document root
Hope your day is well.
I am currently trying to serve images with PHP that is not in the document root. This needs to be account specific so only specific users can access their images.
I am looking into X-Sendfile, but don't know if there's a…

Chris
- 154
- 8
1
vote
3 answers
Is there any way to tell when an X-Sendfile download has completed?
In the interest of cleaning up temporary files on the webserver, I'm wondering if there's any way to tell when X-Sendfile downloads complete... maybe in a log somewhere? My understanding currently is that once you pass off the headers it is…

Osan
- 187
- 1
- 3
- 13
1
vote
1 answer
Unable to implement a working setup for private images and documents in wagtail
in a wagtail project, I need all image and document file URLs to be "private", e.g. to respect the "privacy setting" of the collection that file/instance belongs to.
Further, these URLs must be private even if the URL is known/guessable.
For wagtail…

tombreit
- 1,199
- 8
- 27
1
vote
1 answer
Relative paths don't work in mod_xsendfile at Apache
I have problem, with mod_xsendfile. When I send to Apache header with absolute path (like /home/foo/foo.txt ) everything works fine. But when I use relative links I get strange errors in Apache's logs.
X-Sendfile: ../test.txt
No such file or…

whncode
- 429
- 3
- 15
1
vote
1 answer
Python Flask send pdf file using decoded request.content
I'm having great difficulty downloading files from a sharepoint server in my flask application.
I'm making a get request to the sharepoint api to get the file and it looks successful when I print my download object
But I cant figure out how to…

Rach Odwyer
- 184
- 1
- 14
1
vote
1 answer
Wrong internal redirect alias for X-Accel-Redirect
Nginx internal redirect file search in wrong path.
I'm using nginx and laravel(PHP) and want to doing secure online storage.if user exist and has permission, user can download file. I'm use 'X-Accel-Redirect' for this action.
//it works with…

Umut Akkaya
- 73
- 1
- 3
- 7
1
vote
3 answers
Problems with x_sendfile in Rails
I’m having some problems with John Guenin's x_sendfile (http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/).
When coding the download of a PDF file, I’m using the following code:
def send_the_file(filename)
xsendfile…

mr_urf
- 3,303
- 4
- 26
- 29
1
vote
1 answer
django through lighttpd + mod_proxy + gunicorn: X-Sendfile returns empty responses
I'm using Django behind Gunicorn and lighttpd. As of Gunicorn documentation, I configured Lighttpd to act as reverse proxy towards Gunicorn:
$SERVER["socket"] == "0.0.0.0:80" {
server.document-root = "/home/user/app"
server.errorlog =…

user6369958
- 357
- 3
- 16
1
vote
1 answer
Apache 2.4 + XSendfile appends charset=utf-8 to content-type header
We just migrated one of our web applications (classic lamp stack) from Ubuntu 14/Apache 2.2/PHP 5.5 to Ubuntu 16/Apache 2.4/PHP 7.0. Everything worked pretty smooth. There is only one part that is giving me headaches at the moment:
One route in our…

Marco
- 960
- 2
- 7
- 26