Questions tagged [x-sendfile]

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.

155 questions
1
vote
0 answers

mpeg files behind capability check won't play in Moodle

I have a problem with embedded files in moodle. The files aren't publicly aviable and are served using x-sendfile like this: if(has_capacity(...)) { sendfile(...); } It works fine for files in avi but for files with mpeg the player decides to do a…
Jakub Kania
  • 15,665
  • 2
  • 37
  • 47
1
vote
1 answer

X-SendFile - detect if XSendFilePath is set

I just started using the XSendFile apache module to serve files. Except for the fact that I cannot know when a download is complete, I guess it's pretty good... One problem though, I found out that xsend will return 0 bytes files if XSendFilePath is…
Pierre
  • 4,976
  • 12
  • 54
  • 76
1
vote
1 answer

PHP file download with mod-xsendfile does not download entire file

I am having problem serving downloads from our website. Large files just won't download in full. Download will stop somewhere in between... Example this file (size cca 172MB) won't download in full size (there are other files also). I switched from…
Primoz Rome
  • 10,379
  • 17
  • 76
  • 108
1
vote
1 answer

xsendfile won't work with mod_rewrite

I'm trying to send file from a rewritten URL. Inside the .htaccess file I have: RewriteRule ^foo$ foo.php [L] In foo.php: header("x-sendfile: ".$_SERVER["DOCUMENT_ROOT"]."/filesdir/test.txt"); When browsing to foo.php directly I see the content of…
Niros
  • 632
  • 5
  • 18
1
vote
1 answer

Downloaded filename of file using X-Sendfile

Im using X-Sendfile to send a file instead of readfile. The script processing this, is named download.php and contains this: $video_file = '/path/to/file/file.mp4'; header('X-Sendfile: '.$video_file); header('Content-Type:…
felixjet
  • 605
  • 1
  • 6
  • 11
0
votes
1 answer

Using X-sendfile with utf-8 files without updating my files or database

On my site we have thousands of documents that we want to serve using x-sendfile. Unfortunately, many of them have funky utf-8 characters in their titles, and, what with HTTP not supporting utf-8, x-sendfile doesn't exactly either. I can make…
mlissner
  • 17,359
  • 18
  • 106
  • 169
0
votes
2 answers

Install apache module X-Sendfile on MAMP

How can I install X-Sendfile apache module so that MAMP can use it? I have followed these instructions to install X-Sendfile, but it didn't work (it seems like it just installed it for the default apache installation). I also tried to manually copy…
lakenen
  • 3,436
  • 5
  • 27
  • 39
0
votes
1 answer

Confilict between RewriteEngine and XSendFile

I have following PHP code $filename = 'a56.flv'; $file = "C:/xampp/htdocs/site/flv/a56.flv"; header("Content-Type: application/force-download"); header('Content-Type: video/x-flv'); header('Content-Disposition: attachment; filename="' .…
Huseyin
  • 1,499
  • 2
  • 25
  • 39
0
votes
1 answer

send_file problems in Rails3 DEVELOPMENT mode

I've seen the issues here about send_file and apache/nginx and all point to this line in production.rb config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' Well and good, but what about development? I am on development right now and…
corroded
  • 21,406
  • 19
  • 83
  • 132
0
votes
1 answer

Is there some equivalent of x-sendfile or x-accell-redirect for S3?

I'm building an API and for some responses it will stream the content of S3 objects back to the requester. I would prefer to serve the content directly rather than redirect to send a 302 (e.g. to redirect to a cloudfront distro). The default is that…
Joe
  • 46,419
  • 33
  • 155
  • 245
0
votes
4 answers

xsendfile only works from index

I'm trying to send a file to the user using xsendfile within the code igniter framework. It is all installed correctly, my problem is that it only seems to work from the route, even though every page comes from index.php anyway. This is my…
John Mellor
  • 2,351
  • 8
  • 45
  • 79
0
votes
0 answers

X-Sendfile in Flask/Apache2 not returning files

I'm trying to return images/videos to a user via X-sendfile on my Flask/Apache2 web app but can't seem to manage it. In my apache site configuration I have: XSendFile on …
James Watson
  • 35
  • 1
  • 4
0
votes
0 answers

PHP how to download file send by X-Sendfile?

I have a WordPress site A and send zip file with PHP-X-Sendfile, for example: https://a.com/?download=a will download file a.zip[ if (!empty($_GET['download'])) { $xSendFile = new PhpXsendfile(); $xSendFile->download(WP_CONTENT_DIR .…
cloudinstone
  • 99
  • 2
  • 4
0
votes
0 answers

Large File Downloads in PHP and How to configure xsendfile to work?

I have been trying to get xsendfile to work for the purpose of allowing people to download larger files from my website. I currently have xsendfile downloading empty 0 bytes files. I'm not sure why it's doing that. When I use the readfile() method…
Bernl
  • 1
  • 1
0
votes
1 answer

How to serve a non-ASCII file name with Django and Apache using xsendfile

I wanted to serve protected contents in Django, so I tried to set xsendfile in both Django and Apache. It works for ASCII file names, but when I tried with non-ASCII file name the Apache server responds with 404. What’s going on here? Django: def…
Gopinath
  • 56
  • 5