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
1
vote
2 answers
c sendfile doesn't works the 2nd time
This is a snippet of the LIST ftp's cmd:
count = file_list("./", &files);
if((fp_list = fopen("listfiles.txt", "w")) == NULL){
perror("Impossibile aprire il file per la scrittura LIST");
onexit(newsockd, sockd, 0, 2);
}
for(i=0; i < count;…

polslinux
- 1,739
- 9
- 34
- 73
1
vote
2 answers
c socket send file size and then the file
This is a snippet of client.c:
size_t fsize;
int total_bytes_read = 0, ret_val;
hp = gethostbyname(argv[1]);
DescrittoreClient = socket(AF_INET, SOCK_STREAM, 0);
connect(DescrittoreClient, (struct sockaddr *) &serv_addr,…

polslinux
- 1,739
- 9
- 34
- 73
1
vote
1 answer
Retrieving data after using System.Net.Sockets SendFile
I'm coding a simple TCP client/server in VB.NET to transfer files of all sizes. I decided to use System.Net.Sockets's command SendFile to transfer the bytes through the socket.
On the receiving side, my code to retrieve the bytes works fairly well,…

user1309276
- 109
- 1
- 6
0
votes
1 answer
Tomcat NIO and Sendfile cleaning up the file send
I'm working on a online document management system where users can download multiple documents as a single ZIP file. These files can get to large to handle completly in memory so in that case we use a temp file. That temp file is then send to the…

SvK
- 11
- 2
0
votes
0 answers
Why doesn't nginx use sendfile with sendfile on?
There is following nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 4096;
multi_accept on;
}
http {
autoindex off;
…
0
votes
1 answer
send txt file in telegam via request website to telegram bot
I want to send a file using a request website(https://www.httpdebugger.com/tools/ViewHttpHeaders.aspx) and a bot in telegram
for example this code is for sending a massage in roobt :
TEXT = input('please enter your text : ')
url =…

kingparsa
- 3
- 3
0
votes
3 answers
A simple sendfile program, but not works
#include
#include
#include
#include
#include
#include
int main(){
int fd1,fd2,rc;
off_t offset = 0;
struct stat stat_buf;
fd1=open("./hello.txt",O_RDONLY);…

sliter
- 1,063
- 1
- 17
- 34
0
votes
1 answer
send_filer return None or ended without a return statement
I am trying to do a aplication where the user can dowload a plot.png and a file.csv but send_files doesnt work. Here are my python code:
app = Flask(__name__)
app.USE_X_SENDFILE = True
@app.route('/', methods= ['POST', 'GET'])
def result():
if…
0
votes
1 answer
Error with send_file using flask in Python
I have an application where, through a server, the user needs to download a CSV file and an image that is stored in the same directory as the .py file but it doesn´t work.
Here are my python code:
app = Flask(__name__)
@app.route('/', methods=…
0
votes
0 answers
flask - send gzipped image
below you can find my old code (working) and my new code (not working). problem with the old code is that the images are 500 kb each and are provided while scrolling (lazy loading), so use up a lot of bandwith. The goal is to send the images…

sharkyenergy
- 3,842
- 10
- 46
- 97
0
votes
0 answers
Send pdf files from Flask to React
I use Flask in backend and React in frontend. Users are not required to log in. In the frontend after processing the user's request I present text with links to several pdf documents. Currently, the documents reside in a public folder on the backend…

Philp
- 1
- 1
0
votes
0 answers
Dynamically serving a static HTML page with express?
I'm trying to use a catch all api route to verify that a specific token is included in the header of the api call. Depending on the answer, I want to serve an html file from my directory based on the request url.
My code looks like…

jmaneaglefan008
- 3
- 3
0
votes
0 answers
Problem trying to remove a file after download in Flask
I am writing a small web application in flask that allows users to upload audio files, process them, and then download the processed files.
The problem I'm having is that after the file is processed and downloaded, I can't remove it from the server.…
0
votes
1 answer
Forward image file with Flask middleware
I am creating an app where I have a middleware (Flask) inbetween a client Flutter app and a image provider (Flask). I would like to get images to the Flutter app from the image provider trough the middleware. The middleware is public as an API and…

Pavel Kříž
- 46
- 4
0
votes
0 answers
How to send a file in an array of objects using Vuejs superagent
I need to send an image along with other fields within an array of objects.
Body requisition:
{"items":[
{"name":"agua sem gas","image_url":"","price":0,"cost":0,"stock":0,"is_active":1,"image":{}},
{"name":"agua com…

Daruedo
- 1