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
0
votes
0 answers
Getting the number of bytes served with X-Sendfile
When serving files with X-Sendfile, is it possible to have the number of bytes actually sent to the client? Something like this in pseudo code:
header("X-Sendfile: /files/2GB_file.zip");
header("Content-type:…

Basj
- 41,386
- 99
- 383
- 673
0
votes
0 answers
How to get the number of successful downloads of a 2 GB file by a client?
I need to deliver 2 GB files to clients (who receive a personal download token), I currently use this:
if (is_valid_download_token($token)) {
log_download_start(); // logs token, date, IP
header("X-Sendfile: /files/2GB_file.zip");
…

Basj
- 41,386
- 99
- 383
- 673
0
votes
1 answer
Downloading: Paperclip, S3, Heroku, and x_sendfile
I have what i imagine is a fairly common setup.
My rails 3 app is hosted on Heroku, and i use Paperclip to manage file uploading, of videos and images, with all files saved on Amazon S3. The model that the files are attached to is Entry, and the…

Max Williams
- 32,435
- 31
- 130
- 197
0
votes
0 answers
Protect behind a login all apache files with PHP, mod rewrite and x-sendfile
I'm building a web app with vue/quasar frameworks. The web app is dynamically populated with JSON comming from AJAX requests depending on the user actions.
The GUI created with vue is obviously public (and it's served from another machine that isn't…

Héctor
- 399
- 3
- 16
0
votes
0 answers
Protect AWS media files using Django permissions
I have a Django project which is currently protecting media files by using a view which checks user permissions before using sendfile to serve the media (which is hosted on my webserver) via nginx.
I want to move the media to AWS (from my webserver)…

bodger
- 1,112
- 6
- 24
0
votes
2 answers
Protecting Downloads
I was just testing this download script below. The downloading works fine but the downloaded zip or rar archive is always corrupt and cannot be opened. I tested it on local development server as well as my hosting account.
I am just trying to learn…

usnidorg
- 65
- 1
- 3
0
votes
1 answer
PHP: x-sendfile for litespeed
I use below code for apache :
$file = 'a.mp3';
$mime = mime_content_type($file);
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma:…

Computer Im
- 85
- 1
- 11
0
votes
1 answer
How to setup authorization for proxy request a-la x-sendfile?
In a setting of apache + mod_wsgi and nginx + uwsgi, what could be the way to setup web-server to proxy big "intranet" files requests?
What I am thinking about is a way a la x-sendfile, but where the wsgi application points to a file URL "intranet"…

Roman Susi
- 4,135
- 2
- 32
- 47
0
votes
0 answers
File download stops either with php or xsendfile
I have this remote Windows 2012 (see last edit) server with latest xampp installed.
The users can normally download files (small and very big ones) from there but there are some files (pdf and zips containing the same pdfs, but not rar with the same…

Andrea
- 1
- 2
0
votes
1 answer
X-Sendfile displaying 404 for handler file
I'm attempting to serve files through X-Sendfile via some creative .htaccess rewrites. Boiling it down to the bare essentials, I basically catch any incoming request and route it to a handler file, like so...
.htaccess:
# If the requested file…

Matt van Andel
- 636
- 7
- 13
0
votes
1 answer
x-sendfile activation in apache2
i have microsoft windows server iis 7 and i have installed apache2 on it
the x-sendfile plugin is installed on apache but when i test it by following code
if (in_array('mod_xsendfile', $modules)) {
// If mod_xsendfile is loaded, use X-Sendfile to…

Komeil Tl
- 24
- 7
0
votes
2 answers
X-Sendfile works for all folder and not just XSendFilePath
I have xsendfile module working and files are being served using X-Sendfile header. But somehow files from any folder gets served.
How do I rectrict it so that I can use X-sendfile headers only for specific folders?
I have tried setting…

Sheikh Azad
- 353
- 2
- 11
0
votes
1 answer
Memory doesn't release
I have a function that create a backup of the app and download it in a zip file, with the datas in the databases, images, files, etc. For this i create a big temp file (using the Tempfile class) that send to browser with send_data, but when i delete…
0
votes
1 answer
Rails server file download crashing at send_file
I am working on downloading a file. My rails server crashes every time I download - when it reaches the send_file method.
Controller code:
file_path = '/home/rails/rails_app/public/test.csv'
send_file(file_path, options: {disposition:…

Arpit Vaishnav
- 4,739
- 6
- 39
- 57
0
votes
1 answer
apache x-sendfile can't find file
There are lots of other questions referring to x-sendfile not returning files, but none of them appear to be able to fix my issue.
I am serving images from a directory outside the public root of the site and want to be able to deliver those images…

Coin_op
- 10,568
- 4
- 35
- 46