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
1 answer
Express sendFile breaks
I am constantly getting:
express deprecated res.sendfile: Use res.sendFile instead
here is my code:
app.get('/*', function (req, res) {
var myUrl = req.url.split('/')[1];
myownfunction(myUrl, function (err, rows) {
if (rows.length !=…

passion
- 1,000
- 6
- 20
- 47
0
votes
1 answer
Data loss when sending file via java socket to an Android device
I develop a socket-based chat application in java. I created two client, desktop client and mobile client on Android, and everything was fine with text messages, now that I added the file sending feature, I am faced with indeterminate behavior on…

Mahamadou DOUMBIA
- 81
- 3
- 12
0
votes
1 answer
Memory doesn't release
I have a function that create a backup of the app and download it in a zip file, with the datas in the databases, images, files, etc. For this i create a big temp file (using the Tempfile class) that send to browser with send_data, but when i delete…
0
votes
1 answer
Rails server file download crashing at send_file
I am working on downloading a file. My rails server crashes every time I download - when it reaches the send_file method.
Controller code:
file_path = '/home/rails/rails_app/public/test.csv'
send_file(file_path, options: {disposition:…

Arpit Vaishnav
- 4,739
- 6
- 39
- 57
0
votes
1 answer
Send_data returning corrupted files
I have the following download action in my resources controller:
def download
require 'open-uri'
if validate_token(safe_params[:x])
resource = Resource.find_by_token(safe_params[:x])
data = open(resource.file.url)
…

danielbker
- 392
- 1
- 3
- 21
0
votes
1 answer
express send file error 404 not found
I have the following code server side code:
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
…

FutureCake
- 2,614
- 3
- 27
- 70
0
votes
3 answers
CakePHP 3 image download corrupt
I have followed Cakes Cookbook to send files (http://book.cakephp.org/3.0/en/controllers/request-response.html#sending-files) but I've been facing a weird problem.
PDF's, DOC's and other binaries work just fine. But when I try to download/show an…

Fernando Rybka
- 238
- 1
- 4
- 14
0
votes
0 answers
sendfile() function does not work when invoked for second time
I'm using the following Java code in my pega(Java tool) activity to download the generated PDF document.
//Get the PDF bytes from parameter page.
ClipboardPage page = tools.findPage("eFormSource");
if(page == null){
throw new…

Kalyan Madicharla
- 21
- 4
0
votes
0 answers
APR sendfile for Tomcat 8 does not send small files
I am trying to sendFiles by APR module of tomcat as described in https://tomcat.apache.org/tomcat-8.5-doc/aio.html It works really well for relatively large files(videos, large pdfs etc). However it is unable to send small files(30-40 KB). It does…

kundante
- 2,100
- 2
- 16
- 20
0
votes
1 answer
System.ObjectDisposedException UWP
i've an issue in my application. I'm trying to send an image into FTP server. I'm able to connect with server, authenticate, and other. But when i try to send file, if the file is big (usually bigger than 40-50kb) i got…

Marco Molica
- 3
- 4
0
votes
1 answer
Disconnecting from the server after sending file
I'm trying to send file from TCP client to listener. Its all working but after the file is sent, the client is disconnecting from the server. Here is the code I'm currently using for the client:
public static void SendFile(FileInfo file)
{
try
…

smirnoFz RPM
- 1
- 1
0
votes
0 answers
How to serve static files from nginx subfolders
I am trying to send files from from subdirectories from the nginx server.
When the URL is http://localhost:8080/media/photo.jpg the Nginx sends the file from the path
/Users/utsavdusad/Desktop/Pilot_App_test/uploads
It doesn't send the file from…

Utsav Dusad
- 2,139
- 4
- 31
- 52
0
votes
2 answers
Implementing a chat using sockets client-server-client communication
I've implemented a global chat that communicates through sockets. A client writes a message that is send to the server and than the server sends the message back to all clients. Each client it's represented by a class called ClientThread, so each…

Alex Chihaia
- 103
- 2
- 15
0
votes
0 answers
Android Bluetooth sending file (createChooser)
I'm trying to send a file via bluetooth, but when I'm choosing a file , nothing happens . I'm trying to do this by clicking on the device ( ListView ) > then select a file (after selection activity: files manager) > send selected file to selected…

kicKEj
- 1
- 1
0
votes
0 answers
Receiving incomplete file from a TCP Socket
i'm writing a server-client application and i have a problem sending files; sometimes the transfer is completed correctly, but very often "seems" like the server (the receiver) receives less bytes and continue to wait for other datas while the…