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
0
votes
2 answers
Send other domain's file from expressJs
I have a server (nodeJS, expressJS).
I created a route /abc in which I want to send a HTML file which is stored at Google Cloud Bucket.
I tried using res.sendFile but since it send files from the internal server, so it didn't worked for me.
My code…

Ravi Patel
- 169
- 9
0
votes
2 answers
Dotnet core: send byte array as file from web api without saving it to disk
I have a web api that need to let the user download/inline a binary file I have saved to a database.
So far now I could achieve it like this:
string ContentType = (string) (result["content_type"] ?? "");
string FileName = (string)…

opensas
- 60,462
- 79
- 252
- 386
0
votes
1 answer
FileChannel.transferTo (supposedly zero-copy) not giving any performance gain
I am working on a REST API that has an endpoint to download a file that could be > 2 GB in size. I have read that Java's FileChannel.transferTo(...) will use zero-copy if the OS supports it. My server is running on localhost during development on my…

Ajoy Bhatia
- 603
- 6
- 30
0
votes
1 answer
Yii::$app->response->sendFile() not working on NGINX
I created a web site to share files in a protected way, son i put the files for download out of an accesible folder and when the user asks for download the web checks if it has permission and if it does the send the file using…

Isan Rodriguez Trimiño
- 101
- 2
- 7
0
votes
2 answers
How to send file to my WebService based on Spring Boot from Angular 5 client?
I've spent a lot of time to solve my problem but without success.
I have an Angular 5 client and I want to send a file to my SpringBoot web service so that I can handle with that file on web service side.
My template:
…

Matley
- 1,953
- 4
- 35
- 73
0
votes
0 answers
How to send files via a socket in python
I just coded a little client/server program. I used the socket module of python3 for this.
And i wanted to know how to not only send strings but other datatypes besides the basic datatypes. So for example, images as jpgs or whatever or how to send…
0
votes
0 answers
Rails send files starting multiple GETs
I have 2 Rails apps, App1 and App2.
App1 contains links to controller actions in App2 which in turn returns files (downloads), e.g.:
<%= link_to "Download Video", "http://app2/downloads/download_video", :target => "_bkank" %>
with "downloads" being…

Jon Williams
- 77
- 10
0
votes
1 answer
node JS express framework sendFile("home.html",{context?})
I'm reading the Express framework docs, making my basic login/redirect page routes.
The following route accepts the submission:
app.post('/',function(req,res){
//console.log("USERNAME: "+req.body.username);
//console.log("PASSWORD:…
0
votes
0 answers
Store file via PHP & AJAX
In my js file, I wrote this
var data = {
'atc_file': $('#atc_file')[0].files[0],
};
$.ajax({
url: strSendUrl,
method: "POST",
data: data,
contentType: false,
processData: false,
success: function(result, request) {
…

Androiddevama
- 23
- 2
0
votes
1 answer
Windows 10 - VB 5.2.4 with Ubuntu 16.04: Sending files between two VMs with Python
I'm new to python and this time I want to send a file between two VMs, first of all, the VMs are configured with NAT Network, both VMs can ping each other. The codes are the following:
Server side:
#server.py
import socket #…

nugie
- 23
- 2
- 5
0
votes
2 answers
Why does sendfile not check if reading from the input descriptor would block?
As a server, I want to read from a non-blocking client socket and then write to a file.
According to the man page for sendfile, if errno is set to EAGAIN, then this only signals that, if the output file descriptor is set to be non-blocking, then a…

Muno
- 575
- 2
- 5
- 20
0
votes
1 answer
C file server and client hanging on recv
So I am trying to work on this toy client file server problem.
The iterative version works fine, but when I attempt to fork each new connection in the server code, the client code hangs on the recv call.
I am fairly sure the issue is with the…

a_river_in_canada
- 301
- 1
- 10
0
votes
1 answer
Nginx and Gunicorn with Virtualbox serves old verison of Django static files padded/cropped to new file size, sendfile off doesn't work
My problem is the same one as described here and here, but with the exception that setting sendfile off; in nginx.conf does not help.
I'm running Vagrant with Virtualbox (Ubuntu 16.04) and Nginx, Gunicorn, and Django. I use this setup for…

Erik Lumme
- 5,202
- 13
- 27
0
votes
0 answers
Express sendfile not show images on html
I'm trying to return an html to user when a request is completed, like this:
router.get('/reset-password/:TOKEN', function(req, res) {
Users.someStuff(req.params.TOKEN, function (error, result) {
if (result) {
…

Hanzo
- 1,839
- 4
- 30
- 51
0
votes
1 answer
Flask send temporary file using send_file
I am trying to send an xlsx file to a user. I have it writing to a temporary file, but I'm getting the following error:
TypeError: invalid file:
I'm not sure how to correct this... below is my…

AlliDeacon
- 1,365
- 3
- 21
- 35