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
3
votes
1 answer

Send multiple files with Flask?

I have this code for sending a single file to the user side: Server side: @app.route('/image', methods = ['GET','POST']) def image(): # CU.close() SqlPicPlace="SELECT ImgData FROM tablename WHERE ImgSaveID=2" CU.execute(SqlPicPlace) …
henrry
  • 486
  • 6
  • 25
3
votes
1 answer

Rails, Download from BLOB database

i have one problem I save my upload data in the blob file type in the database.. now i want to download it.. how to manage that i have try this way (document_file is a field with blob data) send_file @attachment.document_file, :disposition =>…
adhitia hidayat
  • 185
  • 1
  • 1
  • 6
3
votes
1 answer

rails send_file and send_data sends out zero byte files

I'm trying to send a pdf back to the user but I'm having serious problem getting send_file and send_data to work. I created the pdf file as follows: tmp = Tempfile.new('filled') new_tmp_path = PDFPrint.fill_form_using_pdftk(template_path,…
Dominic
  • 341
  • 2
  • 5
  • 15
3
votes
1 answer

Is there an asynchronous version of sendfile in Linux?

The io_getevents notification mechanism looks quite capable at first glance, so I would like something I could use with it. I just couldn't find anything yet. On Windows, it's easy: There is only TransmitFile, which can work asynchronously…
purefanatic
  • 933
  • 2
  • 8
  • 23
3
votes
0 answers

Socket Io : send file from node server to python client

As I quoted in the title, I want to send files from my server node to my client python using socket io. I searched for some examples to send files from a browser client to node server like this https://github.com/rico345100/socket.io-file-example.…
Nour_92
  • 81
  • 1
  • 10
3
votes
1 answer

JavaScript: res.sendFile is not a function

I'm not sure why I am getting this error. Here is my code. Express was already installed with npm install express --save var express = require('express'); var app = express(); var fs = require('fs') var path =…
Ahmed Ahmed
  • 105
  • 7
3
votes
4 answers

Node.js - res.sendFile - Error: ENOENT but the path is correct

I'm trying to render an index.html but I get the error enoent, even with the right path. //folders tree test/server.js test/app/routes.js test/public/views/index.html //routes.js app.get('*', function(req, res) { …
Alex
  • 1,230
  • 2
  • 24
  • 46
3
votes
3 answers

Rails send_file rendering files as plain text on new page instead of browser downloading file

When send_file is called, it's sending the file to the browser, but the browser is dumping the contents as plain-text on a new page instead of downloading the file. If I refresh that page, it then downloads the file as normal. Route get 'download'…
Matt Weick
  • 332
  • 6
  • 19
3
votes
1 answer

rails how to know when send_file done

As it takes some time to prepare the content of the data to be downloaded, I want to show a message "Preparing file to download" when the user submits the request Then when the file is ready, I use send_file to send the data Once it's done, I need…
andy
  • 31
  • 2
3
votes
0 answers

SendFile and transferTo in Java

I am using CentOs Kernel version 2.6.32.I plan to do a test with and without transferTo(sendFile) using NIO. My Test is to copy a 1GB file from one directory to another. However i didn't find any significant performance improvement because of using…
3
votes
1 answer

Form freezes when trying to send file over tcp/ip, Delphi 2010

i am facing the following problem. Me and a friend of mine, have set up a wireless network using uhf data modem. When i am trying to send a file (e.g. photo) and the connection is ok there is no problem. But when i am trying to send a file and for…
Dim Papa
  • 31
  • 1
3
votes
2 answers

How do I turn sendfile off in a docker instance

I have a nginx docker instance running. In the docker instance there is a file called /etc/nginx/nginx.conf It has the following settings http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format …
Robbo_UK
  • 11,351
  • 25
  • 81
  • 117
3
votes
2 answers

During TCP send breakpoint influences outcome

I have a problem with the Client/Server application i'm writing. It's aim is to send a specific directory's files in the Client and send them to a directory on the Server. I get the files with a foreach, but when i put a breakpoint at the begin of…
3
votes
4 answers

Yii2 sendfile response

I am new to Yii2 and I would really appreciated if anyone could help me to solve the problem. I want to make a download link and I use Yii::$app->response->sendFile($path, $name, ['inline' => false])->send(); in download function but it just read…
tutulang
  • 31
  • 1
  • 1
  • 2
3
votes
3 answers

How to send end of file without closing tcp socket

I am trying to send a file over a tcp socket in a peer to peer chat system coded in python. The receiving socket seems not to know that there is no more file to receive. The only way I can get the receiving socket to not anticipate the data that…
Pelonomi Moiloa
  • 516
  • 5
  • 12