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
1 answer
Rails - Download multiple files at same time using send_file in a each loop
I want to download a file for each value in my array in a loop.
I have two methods in my class:
def test
testarray = ['value1', 'value2', 'value3']
testarray.each do |value|
download_file(value)
end
end
def download_file(value)
…

valdeci
- 13,962
- 6
- 55
- 80
1
vote
1 answer
C++ Casablanca Restservice send PDF Files to Wordpress Clients
iam developing a rest service in c++ for a wordpress client in a project for a further education.
The service is written in c++ using casablanca as framework for and service and client communicate over JSON.
Now I have to send PDF Files to each…

Cazzador
- 33
- 2
- 9
1
vote
0 answers
sendfile() blocking at linux-2.6.20-1.21
I use sendfile(socket_fd, file_fd, &offset, left_size) at linux-2.6.20-1.21 to send a symbol link file by non-block socket. The sendfile() is blocking when the file size is too large(100K+).
How can I solve this problem?

sfzhang
- 669
- 9
- 18
1
vote
0 answers
Is there any complication of using IFrames in Rails?
I am trying to preview a PDF in my rails application. The file sits in the uploads folder and not in the public or assets folder. So I have a action in my controller called preview which uses send_file.
I have a before filter for preview called…

Karthik Kamalakannan
- 770
- 1
- 11
- 31
1
vote
1 answer
Android Update file to php serve
I am trying to upload image to php server. But it gives me
java.io.FileNotFoundException: http://*******.info/test.php
how can I solve this problem?
package com.androidexample.uploadtoserver;
import java.io.DataInputStream;
import…

Ismail Ozkan
- 21
- 6
1
vote
2 answers
Sendfile without file descriptor
I have a memory region which contains data that I would like to send over ethernet to the other client. To increase the throughput, currently I am fiddling with sendfile API instead of the classic send/write API. But as far as I understand, the…

czteoh
- 85
- 6
1
vote
1 answer
Vagrant 'EnableSendfile off' doesn't work
I'm using Vagrant to set up a web server Apache2. So, I encountered a problem with cache from Apache:
I created a css file in my "Box Sync Folder Source". It's well updated in "Box Sync Folder Target" but when I refresh the browser no change is…

r0r0
- 35
- 6
1
vote
2 answers
Is it possible to use sendfile() to copy directories
I'm trying to use sendfile() to implement a copy program.
However it failed when I was trying to copy directories. Isn't directory a special file type in Linux?
Here is the code I'm using now. It's copied from another answer from StackOverflow.
int…

Ply_py
- 105
- 1
- 1
- 5
1
vote
1 answer
send_file not working - Ruby on Rails
I have this action here :
def download
send_file 'C:/Sites/solver/public/test.zip'
end
When I execute it from my html nothing happens and nothing is downloaded.
But here is the log it produce :
Started POST "/ssh/download" for 127.0.0.1 at…

Guillaume Caillé
- 393
- 2
- 6
- 20
1
vote
3 answers
How to display image from private folder inside View?
I need a quick tip on something which seems really simple. I have some pictures inside private folder and would like to display them inside my View.
The only solution I found was this:
def show
send_file 'some/image/url', :disposition =>…

user3339562
- 1,325
- 4
- 18
- 34
1
vote
1 answer
Protect images uploaded with Carrierwave
I am building a site where I want to protect certain images from download. Only authorized users would be able to download them.
As I upload images with Carrierwave, they are stored inside public/uploads/image. Users can download them via link:
def…

user3339562
- 1,325
- 4
- 18
- 34
1
vote
2 answers
Rails download http response/displayed site
Instead of displaying the xml file rendered by the index.api.rsb file in my browser, i want to download it. To me this sounds very simple, but I cant find a solution.
I tried the following in the controller-method:
def split
if params[:export] ==…

Florian Gl
- 5,984
- 2
- 17
- 30
1
vote
1 answer
Sending files from client to server using Sockets but getting some files with size zero
i'm writing some code where
client takes file names(text files) from command Line
client converts each file to byte array and then send this array to server.
server starts a new thread , each thread is converting a byte array to new file in some…

Dinesh Chander
- 117
- 2
- 12
1
vote
1 answer
send_file in delayed_job class
I generate xls-file in background with help of delayed_job gem. After this I would like to send file to the user. Is there some way to call send_file method outside of controller in delayed_job class?

Sergei Struk
- 358
- 4
- 12
1
vote
2 answers
IRCBot send file / DCC File transfer
I'm implementing a IRCBot to send files but can't find anything on this, has anyone ever done this?
PHP is the language
Symfony 2 is the framework
IRCBotBundle https://github.com/whisller/IrcBotBundle I'm using / modifying
Looking for…

Phill Pafford
- 83,471
- 91
- 263
- 383