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

Serving user stored files outside of apache document root using X-Sendfile. More secure?

I want to allow users to upload all sorts of files and avoid the security risks. For example, I currently do not allow HTML file upload to avoid any risks of users uploading HTML files with malicious javascript code. I am wondering if using…
1
vote
1 answer

Modify filename for file downloaded via mod_xsendfile

I'm using mod_xsendfile to download / show files on a webpage. It works fine, I'm just wondering if there is any way I can modify filenames before sending them? I'm guessing I would have to copy/rename the file temporarily to manage this? Which…
junkfoodjunkie
  • 3,168
  • 1
  • 19
  • 33
1
vote
0 answers

How to make Nginx handle send_file requests on Amazon Linux with Ruby and Passenger Standalone

I cant manage to make Nginx handle my file downloads. They keep being sent by Rails directly, which is not a good idea for known reasons. Files to be downloaded by an iOS app are zipped on an Amazon EC2 instance and put into a folder called…
1
vote
1 answer

uwsgi X-Sendfile emulation mimetype missing?

i'm working on a configuration of uwsgi+nginx for our python web app. I want to add the X-Sendfile emulation (see http://uwsgi-docs.readthedocs.io/en/latest/Snippets.html): [uwsgi] collect-header = X-Sendfile X_SENDFILE response-route-if-not =…
jayven
  • 770
  • 8
  • 19
1
vote
0 answers

Downloads Stops At 2GB For Some Users

I have a website that offer downloads of some large files, up to 10gb. There is an issue with the downloads that doesn't happen to me, and actually doesn't happen to most of my users, but I keep getting messages from some users that their downloads…
HTMHell
  • 5,761
  • 5
  • 37
  • 79
1
vote
0 answers

Rails 3.2 and x_sendfile: partial content (byte range requests) working for images but not working for mp3

Links on my Rails website to mp3-files can not be partially downloaded. But images can. How is this possible? curl --header "Range: bytes=30-50" http://app-staging.mydailylifestyle.com/images/mdl/nl/logo.png?1453478061 -o part1 returns a file of…
dirkjan
  • 11
  • 2
1
vote
2 answers

upload analogue with XSendFile?

Is there some way to use something similar to x-sendfile for uploading files, e.g. saving particular stream/parameter from request to file, without putting it wholly into memory? (In particular, with apache2 and ruby fcgi)
HoverHell
  • 4,739
  • 3
  • 21
  • 23
1
vote
1 answer

XSendFile Apache2 mod has zero bytes

My code, the paths are correct and the content length is correct header("X-Sendfile: " . $savePath); header('Content-Length: ' . filesize($savePath)); header("Content-type: $type"); header('Content-Disposition: attachment; filename="' .…
Jake N
  • 10,535
  • 11
  • 66
  • 112
1
vote
0 answers

Installing mod_xsendfile in MAMP Pro causes Apache not to load

I am on OSX Yosemite and currently trying to install mod_xsendfile. I followed all the steps there without encountering any problems: http://patrickward.com/2013/01/07/adding-the-x-sendfile-module-to-mamp-pro/ Now, when I try to start MAMP Pro, it…
Etienne Noël
  • 5,988
  • 6
  • 48
  • 75
1
vote
0 answers

Nginx X-Accel-Redirect config for Rails app

In all the tutorials one may come across for setting up X-Accel-Redirect for nginx, there is always a bit about indicating a certain location is private, like so: location /protected/ { internal; root /some/path; } The files I'm sending to my…
tybro0103
  • 48,327
  • 33
  • 144
  • 170
1
vote
2 answers

mod_xsendfile won't work with CGI and mod_rewrite

I am trying to use the apache module xsendfile to get a better performance during file streaming. The problem is, that it is just working if I DO NOT use PHP as CGI Version AND if I DO NOT USE rewrite rules for my urls. Problem 1:…
Johnson_145
  • 1,994
  • 1
  • 17
  • 26
1
vote
2 answers

PHP, X-SendFile: Sending file together with outputting text to the browser (via echo)

I use X-SendFile Apache Module to download large files from the server. Downloads work well. However, when the download starts, I need to output some text to the browser, such as: "Thanks for downloading the file...." My problem is, that I can not…
Bunkai.Satori
  • 4,698
  • 13
  • 49
  • 77
1
vote
2 answers

Using X-Sendfile to mask the location of static file

I offer paid videos on my website which are only available to members. At the moment, I'm doing the entire authentication and video streaming through a PHP script, however it tends to use a lot of resources and I'd like to use nginx to actually…
John Dorean
  • 3,744
  • 9
  • 51
  • 82
1
vote
1 answer

X-Sendfile notification after finish download

I would need to set the download status to 0 when download has finished. I am using x-sendfile, but after finish download, dont set status. My code: header("X-Sendfile: $file"); header("Content-type:…
1
vote
1 answer

Flask development server with X-Sendfile

I have a Flask application that will run under Apache in production. I have some static files, but they require authenticated access. So using X-Sendfile seemed reasonable to speed up the file delivery after authentication: flaskapp =…
jpmc26
  • 28,463
  • 14
  • 94
  • 146