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
sending file over socket only works one time
I made a code that sending files from one computer to another,
the problem is that after one sending its not working anymore.
I know that the problem is when i'm writing to the writer but I don't know why its not working.
client:
File file =new…
0
votes
2 answers
How can I serve image files with PHP with the same speed as if the image was linked directly?
This is what I need to achieve:
Request: http://www.example.com/image5.jpg
Should rewrite, for example:
RewriteRule ([^.]+)\.jpg$ /image.php?image=$1
Now, in my image.php, how do I serve the image, if I know where it is?
For example:

Frantisek
- 7,485
- 15
- 59
- 102
0
votes
0 answers
Nginx test another location after ^~ found
I am using sendfile on nginx 1.4.4, php 5.5.8 (from WT-NMP) on Windows 7. I have those two locations in config.
location ^~ /upload_folder/ {
internal;
alias "c:/WT-NMP/WWW/m24/upload/";
}
location ~…

marag
- 1
- 1
0
votes
1 answer
How to append bytes to first of stream in sending file by NetworkStream
i want append 8 bytes of my info to first of stream in sending file.
i use NetworkStream and my code is this:
Stream Fs = File.OpenRead("filepath");
Byte[] buffer = new Byte[Fs.Length];
Fs.Read(buffer, 0, buffer.Length);
…

hahamed
- 309
- 1
- 2
- 12
0
votes
0 answers
Send multing large file with socket vb.net
I'm coding an app about LAN chat, i want to send multing file large synchronous with the same port, how to do now? i just can send multing file with case 1 file 1 port :( please help me, thanks.

tungnguyen
- 29
- 5
0
votes
2 answers
how to serve or force file download located from a different directory in meteor to client browser
A user comes to my site and inputs something, and my site generates a file as an output.
Unfortunately i cannot place the generated file on the public directory - as you all now Meteor watches this and restarts every time the public folder content…

David
- 4,235
- 12
- 44
- 52
0
votes
1 answer
Haskell sendFile function
Where can I find some actual examples of sendFile function (Network.Socket.SendFile lib). When I tried to do all by official manual, I got an error:
Exception: {file path}: withFd: resource vanished (Broken pipe)
is it some light-sense example of…

Lissomort
- 103
- 1
- 1
- 7
0
votes
1 answer
How do I copy a file multiple times to make successively bigger files in C
I need to make a number of large text files of varying sizes, in exact multiples of megabytes (in other words, exactly 10 MB, 50 MB, 100 MB, and I'm not sure how big I'll have to go).
I don't want the files to be all ones or zeroes, so I have a…

punstress
- 1,177
- 2
- 14
- 26
0
votes
2 answers
Send File Programmability in C#
How would you go about detecting, blocking, or just in general referring to the Send File operation you can do to any file/folder on Windows. What exactly is happening when a send file happens and is there any kind of built in programmability in…
user1448018
0
votes
1 answer
A socket operation was attempted to an unreachable host windows CE
I'm sending file from smart device windows CE via wireless to PC , the file is sending by TCP, it works properly when I was testing it by deploy the application via active synchronize from my laptop. but when the application installed inside the…

batool hamwy
- 3
- 2
- 4
0
votes
1 answer
Trouble transmitting *.exe file with Socket.SendFile()
Using C# in .NET 4.5 in Visual Studio 2012 Ult on Win7 x64.
I’m trying to make a server transmit files via the System.Net.Sockets.Socket.SendFile(string filename) method and a client to receive it. The client appends received bytes to the end of…

Nat
- 1,085
- 2
- 18
- 35
0
votes
1 answer
how to protect a send_file action with cancan
I can't seem to approve authorization for the web_videos_display action. I can make it work by using the skip_authorize_resource but then any user can access the URL for the file by knowing the :id. I need to require access to the asset to "see" the…

T. Weston Kendall
- 349
- 6
- 17
0
votes
2 answers
c socket sent file contains other messages
This is a simple implementation of the RETR cmd where the server first receives the filename and then it sends the file.
/************************* RECEIVE FILE NAME AND SEND FILE *************************/
if(recv(newsockd, buffer, sizeof(buffer),…

polslinux
- 1,739
- 9
- 34
- 73
0
votes
1 answer
C sendfile and then other text
This is a snippet of my client code:
while(((uint32_t)total_bytes_read != fsize) && ((nread = read(sockd, filebuffer, sizeof(filebuffer))) > 0)){
if(write(fd, filebuffer, nread) < 0){
perror("write");
close(sockd);
…

polslinux
- 1,739
- 9
- 34
- 73
0
votes
2 answers
Node.js expressjs fastest way to store and display a html page
I want to display a static HTML page with expressjs. What's the fastest way to do so? Currently I have a html file stored in the file system and I'm using res.sendfile(home + "/public/file.xml")
Is sendfile the fastest way to do it or might storing…

Harry
- 52,711
- 71
- 177
- 261