Questions tagged [sendfile]

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

279 questions
0
votes
1 answer

How can I return a file using react? Or `npm unload` analogs for express

How can I return a file using react? In express, this is sendFile. If the file is exe, then it will be downloaded, if it is a pdf file, then it will be displayed in the browser, if the picture, then it will also be displayed. I would like to know…
0
votes
1 answer

NodeJS Express Routing - Only first request gets rendered

In the server script I try to deliver different html files. When app.post('/login'...) comes in, res.sendFile() is working and the html gets rendered. On the second call, whenn app.get('/go') comes in, the file gets served, but not displayed. I…
Kuseng
  • 3
  • 1
0
votes
1 answer

Sending file in C#

Can I send file on one port to more computers at the same time in C#? Like I have code to send by System.Net.Sockets on port 1234and I want to send file to 5 computers. Can I do it at the same time?
FrewCen
  • 636
  • 1
  • 7
  • 21
0
votes
1 answer

Why is it that when I send a simple file from express, the client consumes a lot of memory?

When I open the html file from the browser it consumes the following: But when I send the same file from an Express server, the memory consumption is noticeably higher: It is true that this is not a huge memory consumption, but it is a VERY…
Grizzly
  • 371
  • 2
  • 13
0
votes
1 answer

When downloading a txt-file with send_file, safari and chrome browsers are not able to parse it

I have a set of entries which descriptions contain several sentences each. I need to export all of these sentences to a `txt-file. Each sentence gets a unique id and starts on a new line. 0000000001[tab] This is line one 0000000002[tab] This is line…
0
votes
1 answer

Jenkins Publish Over SSH: How to give windows directory(Eg: E:\Test\SFTP\In\Test.txt) in Source file and remote UNIX directory in Remote directory

Can some please help me using the directory structure in the Jenkins job for sending files to the remote ssh server? Jenkins Publish Over SSH: How to give windows directory(Eg: E:\Test\SFTP\In\Test.txt) in source file and Remote directory in…
0
votes
1 answer

How to zip an html file from a stream/rendered dictionary?

I am having trouble downloading an html file through the flask send_file. Basically, to download an html file alone, it works perfectly. by giving the stream to the send_file function as a parameter However; I need to put this file into a zip…
Josh.h
  • 71
  • 1
  • 13
0
votes
0 answers

Serve file to client with Flask

My server generates a dataframe upon receiving a request and I want to send it back to the client as a CSV. I have a few questions as this is my first time doing this: If file is saved with same name each time, does this create conflicts for…
mrk
  • 3,061
  • 1
  • 29
  • 34
0
votes
2 answers

How to send file in python over network without loosing data?

I'm trying to send a file data.txt that contains this words 'hello world' over my network using 2 files in Python, one called server.py : import socket import tqdm import os # device's IP address SERVER_HOST = "0.0.0.0" SERVER_PORT = 5001 # receive…
user15403136
0
votes
1 answer

Unable to view image when client calls server's FLASK end point via send_file command

I have a Flask application running in python. There is a client that is serving images from disk. I would like a server to hit an end point and retrieve the images. On the client's side: @app.route('/api/get_image') def get(self, id): # Map id to…
trycatch22
  • 307
  • 4
  • 14
0
votes
0 answers

res.sendFile, res.download PDF File

I have currently a problem to fetch my pdf from the backend to the front-end. I'm using NodeJS. I have all my pdf made with Puppeteer and saved on a PDF directory. I'm trying to fetch these PDF for the front-end. (for download) I'have tried with…
user13130661
0
votes
1 answer

Express.js not sending html file on post request

I'm just trying to send HTML file upon POST request. I'm 100% sure it was working an hour ago. Since then, I cannot figure out why it's not working all of a sudden! Server Router: const express = require('express'); const router =…
passionateLearner
  • 722
  • 1
  • 7
  • 19
0
votes
0 answers

how can i use res.sendfile method in a post request

I have a form and I want it to use post request in it what I wanna do is ask for a username and password in the form and send the details back to the server from there check for credentials and send the static page if its correct but whenever I use…
0
votes
1 answer

Can I send XLS/XLSX files using Express res.sendFile()?

I've posted too many questions about this but I keep hitting a wall so I keep asking. Can you send an XLS or XLSX file using Express' res.sendFile()? Here's the code I'm using: res.sendFile( path.join(__dirname, '../testing/'), …
teej
  • 105
  • 3
  • 12
0
votes
0 answers

Nodejs sendFile() disable line wrap

I want to open a text file on new tab. However, this file has long lines which I don't want to wrap. How do I disable line wrap? let path = '/a.txt'; res.sendFile(path);