x-sendfile

Alternative of send_file() in flask on Pythonanywhere?

余生颓废 提交于 2021-02-07 14:43:08
问题 I am new to python and still learning. I created a small python 3.6 Flask webapp on pythonanwhere and found out that send_file() is not working on pythonanywhere servers. I am actively looking for an alternative to download an excel file directly on the user machine. I also tried Response but it is not giving desired output. I read alot about it online and found that the send_file works fine if we set below wsgi-disable-file-wrapper = True However, i don't know where to set this as i couldn't

Flask development server with X-Sendfile

痴心易碎 提交于 2020-01-05 11:56:09
问题 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 = flask.Flask() flaskapp.use_x_sendfile = True Then where I'm generating the response: return flask.send_file(filepath) It seems to work fine under Apache. The problem is when I run the development server: # Use SharedDataMiddleware to deliver JS, CSS, icons, etc.

HTTP File Download: Monitoring Download Progress

拜拜、爱过 提交于 2020-01-01 03:29:49
问题 I am in a situation, when I have to implement downloading of large files(up to 4GB) from a Web server: Apache 2.4.4 via HTTP protocol. I have tried several approaches, but the best solution looks to be the usage of X-SendFile module. As I offer progress bar for file uploads, I would need to have the same feature for file downloads. So here are my questions: Is there any way, including workaround, to achieve file downloads progress monitoring? Is there any way, including workaround, to

Install apache module X-Sendfile on MAMP

两盒软妹~` 提交于 2019-12-24 20:04:18
问题 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 /usr/libexec/apache2/mod_xsendfile.so to /Applications/MAMP/Library/modules/ , but that produced the following error when restarting Apache: Cannot load /Applications/MAMP/Library/modules/mod_xsendfile.so into server: cannot create object file

How to solve the memory-leak with send_file (or send_data) on Heroku?

房东的猫 提交于 2019-12-24 14:06:26
问题 I have a Rails 3 app that needs to generate an image and send the data to the browser. The app must be deployed on Heroku. However, Heroku only supports streaming through Mongrel which holds on to the memory. This then causes Heroku to slow, then kill the thread after a dozen or so requests. https://devcenter.heroku.com/articles/error-codes#r14-memory-quota-exceeded I am currently using send_data or send_file from ActionController::DataStreaming http://api.rubyonrails.org/classes

mod_xsendfile for Win x64?

房东的猫 提交于 2019-12-19 03:12:26
问题 I'm trying to install the mod_xsendfile Apache Module on Windows (7) x64 (using Apache 2.2) -- yes I'm doomed from the get-go, I know :-). Apparently there is : a) No Win x64 binary for mod_xsendfile, just a Win32 binary from the module's website b) No Win x64 binary for apxs from ApacheLounge I've tried the usual LoadModule xsendfile_module modules/mod_xsendfile.so but the semi-obvious error ( httpd: Syntax error on line 127 of C:/Apache/conf/httpd.conf: Cannot load C:/Apache/modules/mod

mod_xsendfile with symbolic links

不想你离开。 提交于 2019-12-18 16:45:10
问题 I'm running into an issue using xsendfile with my Rails 3 app. I'm using capistrano to manage deployments and in each release, there is a symbolic link to the shared/assets dir (e.g. /var/www/site/releases/1234/assets => /var/www/site/shared/assets). The problem is that that XSendFile doesn't seem to follow the symbolic links. In my apache logs, I'm seeing the following error: The given path was above the root path: xsendfile: unable to find file: /var/www/site/releases/20110406205607/assets

symfony2 store uploaded file non rootweb

回眸只為那壹抹淺笑 提交于 2019-12-18 09:51:06
问题 I have problem with uploading files, I'm saving uploaded files in a non public folder (non webroot folder), and then I want to get the webPAth of all uploaded files to use them in a video gallery. $videos = $repository->getVideosThumbs($this->getUser()); and then in my twig {% for video in videos %} <a href ="{{ path('neoctus_videobundle_default_watchvideo', {'id' : video.id, 'salt' : app.user.salt }) }}" > <img id="{{ video.id }}" src="/uploads/images/{{video.imgPath}}" alt="1st image

mod_xsendfile won't work with CGI and mod_rewrite

瘦欲@ 提交于 2019-12-13 02:40:44
问题 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: mod_rewrite Calling this one in the Browser will work: http://subdomain.domain.de/image.php This one will give me a 404: http://subdomain.domain.de/rewrittenImageUrl The rewrite rules are working right. The 404 error is triggered by the xsendfile module. If I add a

xsendfile won't work with mod_rewrite

穿精又带淫゛_ 提交于 2019-12-11 09:31:41
问题 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 the file, but when browsing to /foo I get 404. I've tried to search the web but couldn't find any solution for this other than redirecting foo to foo.php does anyone knows what's the problem and how to solve it? 回答1: I solved the problem. In httpd