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
4
votes
4 answers
With sendfile(), is it possible to tell when in_fd is at EOF?
Reading through the man page of the Linux system call sendfile, I am wondering whether it is possible for the calling program to know when in_fd is at EOF. Presumably, this could be signaled by a return value of 0, but this leads to the question of…

Daniel Trebbien
- 38,421
- 18
- 121
- 193
4
votes
1 answer
sendfile() / TransmitFile() with encryption/decryption
How do I get the benefit of sendfile() (on Linux) and TransmitFile() (on Windows) if I also want to use encryption? Are there any Linux kernel modules or Windows drivers that provide this functionality? The only thing I've found this far is an…

Display Name
- 2,323
- 1
- 26
- 45
4
votes
1 answer
flask send_file not working with tar.gz files
I have a my_folder.tar.gz archive with a structure
my_folder.tar.gz:
my_folder/
file1
file2
And I construct a basic flask endpoint, say:
@blueprint.route('/download')
def download():
return…

stpk
- 2,015
- 1
- 16
- 23
4
votes
1 answer
How to set content length by send_file
I don't know how to set content-length by send_file.
I checked the api, there's no content-length param.

Gabriel Tong
- 206
- 3
- 12
4
votes
2 answers
Best approach to send big files to a server in a automatic way using a rest api?
I need to to send files to a server using rest api. I cannot use a browser as a client and the file should be sent with a http method. It has to be made automatically (using jenkins or so).
All I want to know is what is the best approach. The best…

André Henriques
- 75
- 1
- 6
4
votes
1 answer
sendfile() usage on two mmaped files (linux)
Can sendfile() linux syscall be used to send part of file from one mmaped file to other mmaped file?

osgx
- 90,338
- 53
- 357
- 513
4
votes
1 answer
Node express routing sendfile fails depending on file location
I have a directory structure for a restful express service + Backbone client with pushState enabled like this (client code in public/)
app.js
lib/routes.js
-- public/
-- index.html
I set up /public to be a static directory in…

Dominic
- 62,658
- 20
- 139
- 163
4
votes
5 answers
How to download file with send_file?
Can someone enlighten me how can I download file with send_file?
I have a file image.jpg inside app/assets/images. I've tried this in my controller:
def download
send_file ("#{Rails.root}/public/images/image.jpg")
end
def download
send_file…

user3339562
- 1,325
- 4
- 18
- 34
4
votes
2 answers
Rails 4, asset pipeline causes user downloadable files to be downloaded twice
I have a folder in my app directory named "uploads" where users can upload files and download files. I don't want the uploads folder to be in the public directory because I want to control download authorization.
In my controller, I have:
send_file…

MichaelHajuddah
- 547
- 5
- 18
4
votes
1 answer
Is a sendfile() like operation possible with linux-aio?
I want to send data from one file descriptor to another via linux-aio without buffering and without transferring data to and from user space. Is such a sendfile64() funktion possible with linux-aio?
I looked at some linux-aio examples (in C/C++) and…

Philip Schneider
- 43
- 2
4
votes
5 answers
Delete folder after send_file in Rails
I'm sending the file file.txt from my Rails controller using send_file, and then delete the folder containing it.
send_file("#{Rails.root}/public/folder/file.txt")
FileUtils.remove_dir "#{Rails.root}/public/folder", true
When I did this, file.txt…

JJ Beck
- 5,193
- 7
- 32
- 36
4
votes
1 answer
Ruby On Rails: send_file through jquery/ajax request
I am having trouble downloading files from my rails server through ajax:
I have a show action in my downloads controller that calls send_file if a parameter is passed to the show action.
I then have a page where there is a select dropdown that shows…

rhfannnn
- 195
- 3
- 10
3
votes
2 answers
How would you receive a file sent with 'sendfile'?
I'm trying to implement a basic file server. I have been trying to use the sendfile command found here: http://linux.die.net/man/2/sendfile I'm using TCP.
I can have it send fine, but its sending in binary and I'm not sure if thats the hang up.
I…

user974703
- 1,653
- 4
- 20
- 27
3
votes
2 answers
Nest.js and Archiver - pipe stream zip file into http response
In my node.js application I'm downloading multiple user files from AWS S3, compress them to single zip (with usage of Archiver npm library) file and send back to client. All the way I'm operating on streams, and yet I can't send files to client (so…

Furman
- 2,017
- 3
- 25
- 43
3
votes
0 answers
Error while calling the send_file function from another file in python flask | RuntimeError: Working outside of request context
Greetings stack overflow community, I am currently working on a flask app and I am trying to retrieve a file from a helper function with the send_file method in flask.
I have a route that goes like…

gmz21
- 31
- 2