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
0 answers
addling common header file in Nodejs Express
I am using HTML file and Express using NODEJS
exports.sendDashboardHtml = function(req,res,next){
res.sendfile(HTMLLOCATION+'/dashboard.html');
};
which is delivering the HTML File with no problem. Now i want to add common header and footer file…

sunny jindal
- 91
- 9
0
votes
0 answers
Protect AWS media files using Django permissions
I have a Django project which is currently protecting media files by using a view which checks user permissions before using sendfile to serve the media (which is hosted on my webserver) via nginx.
I want to move the media to AWS (from my webserver)…

bodger
- 1,112
- 6
- 24
0
votes
2 answers
html file does not appear after logging without any error
I am new to server-side programming.
I am trying to serve a HTML file (mapview.html) after authentication ,but it does not appear without any error.
there is no problem with authentication process. I expect when I click on login button, the codes…

ehsanpaknahad
- 15
- 4
0
votes
0 answers
python 3 sending a file through a socket
I'm trying to send files from server to client with the code here and doesn't succeed, the client gets stuck on the last recv. Server is done sending all the times. I've tried many things to try to solve:
sending 'STOP' when server is done sending…

Ron Rozenblum
- 13
- 4
0
votes
3 answers
send_file issue
I am using send_file to send some CSV data that I generate.
file = "public/text.csv"
File.open(file, "w"){ |f| f << "Hello World!" }
send_file(file, :type => "text/csv; charset=utf-8")
But I get this downloaded via send_file (It should download…

fl00r
- 82,987
- 33
- 217
- 237
0
votes
1 answer
TCP File Transfer - Kernel copy mechanisms
I am wondering, if the speed of copy processes between user and kernel space, and in general within the whole tcp send/receive process, is dependent on the type of file (.txt, .mp4).
I mean not the file size, but the "structure" of the bytes or…

user11699259
- 1
- 1
0
votes
1 answer
Python Flask : Returned file is not readable
While implementing a rest API in python flask, I have used several options to return a file (any type) , read it and save it to local repository of request but encountered with multiple errors as below:
Case 1:
def download_file():
return…

Shah Muhammad Talha Tahir
- 316
- 1
- 3
- 11
0
votes
1 answer
yii2 how to use response sendFile() with pjax
I have observed that when I execute the function:
Yii::$app->request->sendFile() within a row with a gridView, instead of launching the file, it shows it embedded in the HTML.
Then if I remove the Pjax::begin() and Pjax::end() borders that enclose…

Tomas Grecio Ramirez
- 360
- 4
- 10
0
votes
2 answers
Send jsonfiles to EventHub using Python
I need to send jsonfiles from my folder to azure-EventHub using Python
import json
from azure.eventhub import EventHubClient, Sender, EventData
# Address can be in either of these formats:
#…

satya veni
- 17
- 1
- 8
0
votes
1 answer
How can I catch the errors in sendFile function?
In one of my routes I want to send file with sendFile function but I want to catch the errors may be occurred during send function. I wrote this code but the error which I throw not be caught by catch block and app crashes:
try {
…

babak rekabdar
- 25
- 5
0
votes
0 answers
Using sendfile() on fd returned by epoll
I'm writing a simple TCP server for file transfer.
The server uses an epoll objects to monitor incoming connections and data and I would like to use the sendfile() method in order to allow faster file transfer.
Trying to use sendfile() on an fd…

Barak Sason Rofman
- 39
- 6
0
votes
1 answer
What is the process by which sinatra's send_file decides what content-type to use?
What is the process by which sinatra's send_file decides what content-type to use?
For example, it seems that it works by the extension of the file passed to send_file, so if it is send_file blah.txt . then when I http to the route, I will get/ the…

barlop
- 12,887
- 8
- 80
- 109
0
votes
1 answer
sendfile() doesn't work to copy normal text file
The problem with sendfile is it can't copy two text files using the file fds.
The error is EINVAL.
// Descriptor is not valid or locked, or an mmap()-like operation is not available for in_fd.
What does this really mean ?
From the man page of…

siddhusingh
- 1,832
- 4
- 25
- 30
0
votes
0 answers
read sended file from rest with php
i have a node js api that send file like this
exports.myFunction = function(req, res) {
res.sendFile("path_to_file");
}
and in php i try to read the file received like this :
$client = new GuzzleHttp\Client();
$res =…

user2285831
- 419
- 1
- 5
- 18
0
votes
1 answer
Google document viewer with rails
I'm trying to embed the Google document viewer (http://googlesystem.blogspot.com/2009/09/embeddable-google-document-viewer.html) on my Ruby on Rails site and it keeps displaying "Sorry, this type of document is not supported for viewing". My rails…

Zach
- 2,441
- 1
- 16
- 20