sendfile is the general function representation of sending data/file over the network. The network may be raw tcp sockets or any other connection itself. This tag should be used for querying about such file sending methods defined in different web/(android etc.) frameworks
Questions tagged [sendfile]
279 questions
2
votes
2 answers
Linux sendfile source
Where I can get sendfile function sources?
I can't find it in kernel sources...

Anton
- 39
- 2
- 4
2
votes
0 answers
How to export CSV to browser on client side
I can export a CSV when I make a request from my localhost to my project folder, but I can't figure out how to export it to my browser downloads folder from the localhost. I am using the send_data method as shown below. Any ideas?
class…

Zach S
- 77
- 1
- 8
2
votes
4 answers
Download using Yii::app()->request->SendFile returns corrupted file
I've been trying to download my uploaded file from a specific directory like this:
Yii::app()->request->SendFile($model->statement,
file_get_contents($path.$model->statement)
);
It recognizes the…

Haryth Hilmy
- 21
- 1
- 2
2
votes
3 answers
Django download file empty
I am writing a simple function for downloading a certain file, from the server, to my machine.
The file is unique represented by its id. The file is locatd corectly, and the download is done, but the downloaded file (though named as the one on the…

dana
- 5,168
- 20
- 75
- 116
2
votes
1 answer
X-Accel-Redirect never set in rails 4 app when calling send_file
I'm working with a rails 4 app served with Puma and Nginx. In trying to directly serve certain files I've set
config.action_dispatch.x_sendfile_header = "X-Accel-Redirect"
in config/environments/production.rb, and I can confirm the setting is…

Craig
- 419
- 4
- 19
2
votes
2 answers
Linux supports splice() and sendfile(), how about Android?
Does Android support splice() and sendfile()?

user2638327
- 33
- 4
2
votes
4 answers
Ruby on Rails send_file doesn't work until i refresh the page?
I am working on a Rails server which I can download my locally stored movies and anime etc from. This is kind of working but when I click the download link I have to refresh the page in order for the download to actually start.
This is the…

user3551655
- 21
- 1
- 3
2
votes
1 answer
The image can not be rendered using send_file in IE
I have used a controller action for dynamically rendering image files from a url with the following method:
send_file( image_url, :disposition => 'inline', :type => 'image/jpeg', :x_sendfile => true )
Images are not showing up in…

Debadatt
- 5,935
- 4
- 27
- 40
2
votes
1 answer
Socket Programming in C - Sending a file from Server to Client
I have socket code and client code below. So far all that it does is establish connection with the server, but I want it to also send a file from the client to the server; even if the file has no data in it. What do I have to do to augment this code…

B.D.
- 31
- 2
- 6
2
votes
1 answer
Downloading Rails Assets - File-paths In Development vs Production
I have a downloads_controller.rb with a single download action which I want to trigger the download of a file that lives in a folder called downloads which lives in a folder called download_assets which I have added to my asset paths.
-…

Undistraction
- 42,754
- 56
- 195
- 331
2
votes
0 answers
Nginx throwing HTTP 500 when serving protected asset with send_file
I am having problems serving protected assets (PDFs) with Nginx + Unicorn + Rails. Problem is that sometimes the file is sent properly but other times Nginx returns an HTTP 500 though the Rails log looks good:
Started GET…

lawitschka
- 745
- 3
- 9
2
votes
1 answer
Ruby on Rails: How to download a file with send_file and still show a view
I'm sending an email with a link to a downloadable brochure.
Here's my download action
def download
@thing = Thing.find_using_slug(params[:id])
send_file @thing.brochure.path,
:type => 'application/pdf',
:filename =>…

JonathanW
- 424
- 3
- 16
2
votes
2 answers
How to use pika to send a file via rabbitmq?
I have looked through the tutorials on rabbitmq and find it useful.
But I can't find a document telling how to send files via rabbitmq, using pika.
Code examples are preferred, and other libraries other than pika are acceptable.

can.
- 2,098
- 8
- 29
- 42
2
votes
2 answers
How to solve the memory-leak with send_file (or send_data) on Heroku?
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…

multipolygon
- 2,194
- 2
- 19
- 23
2
votes
2 answers
How to get browser's socket for sendfile() in fastcgi ?? (in C)
I'm trying to file upload and download in fastcgi.
To use sendfile() I need the web server's open socket to the client (browser).
fastcgi doesn't pass it to me (I don't think).
I'm clueless on how to get the browser's socket descriptor.
I'm also…

garyM
- 802
- 2
- 12
- 29