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
1
vote
1 answer

How To Send A File By Sockets On TCP Protocol In C#?

I have a serious problem with this code. This is how it should work: Client connects to server and choose a file on disk. after that client sends a (byte[] buffer) to the server by this format("File" (4 bytes) + FileNameLength (4 bytes) +…
mamadh1378
  • 41
  • 3
1
vote
1 answer

How to download large file with binary mode in python?

I am code a download function in python. The file size >1GB. The server is linux, HTTP server is Karrigell. Client is browse, Firefox or IE. I meet a big trouble. At first, I use sys.stdout() to send file content. file = open(path, 'rb') size =…
Bobby
  • 11
  • 1
  • 2
1
vote
1 answer

Send file over socket with a header with a single system call in Java

I have a huge file, trying to send a portion of this file with a header and trailer. (a header + a portion of this file + trailing data) Obvious solution is SocketChannel.write() which includes multiple system calls. So, I'm open to suggestions.…
Ronald
  • 13
  • 2
1
vote
1 answer

send multiple files parallely using tcp connection between client and server in c#

How can i send multiple files between a client and a server in c# parallely. I have already tried to send single file ,the code is given below. And also please explain difference between sending a file without using socket(as done below) and using…
Pujasvi
  • 13
  • 3
1
vote
1 answer

How to send multiple images in a Expressjs api get request with sendFIle()

I'm looking for away to send multiple images in one GET request from an Expressjs server through an api. I want to create an image gallery of each users uploaded images in a MEAN stack. When images are uploaded using multer, the image information is…
1
vote
2 answers

rails send_file with nginx

I am trying to send a file via send_file, in rails 3... The file is found and is seemingly sent too, but for some reason it is not received... Also even though :disposition => 'inline' is set, the browser always shows a "download box"... In nginx…
Amit
  • 3,952
  • 7
  • 46
  • 80
1
vote
0 answers

`mmap` and `sendfile` interoperability

I have a file, which is opened by open: fd = open("ABC", O_RDWR | O_NOATIME); The file is memory-mapped by mmap: ptr = (uint8_t*)mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); Everything works OK. Then at some point I call…
HEKTO
  • 3,876
  • 2
  • 24
  • 45
1
vote
2 answers

How to send picture through rabbitmq with additional data?

For now, I can send a picture through rabbitmq, but don't know how to do it with some additional data, for example, a number. My guess is that, convert the picture into a base64 string and append it with the number (separated by a unique symbol)…
Anh Cao
  • 482
  • 7
  • 13
1
vote
0 answers

How to use the dmafd from iotcl VIDIOC_EXPBUF with sendfile?

The ioctl VIDIOC_EXPBUF exports the dma memory as a filedescriptor. I want so transfer these memory over the network using sendfile (because it is really fast compared to send() or write()). But sendfile() does not work on these filedescriptor.…
john s.
  • 476
  • 9
  • 21
1
vote
0 answers

C sendfile function in openSSL in embedded system

I'm adding openSSL in an embedded system dedicated to video. In the code there is C function sendfile. A socket as ouf_fd and a file descriptor as in_fd. How can I rewrite this function using openSSL ? I tried using BIO or SSL_set_wfd/rfd but I am…
Render
  • 41
  • 6
1
vote
1 answer

Download File From Another Directory In Flask

Im New In Flask . I'm try to make download list of /var/ directory files but i can't find any way to make this link . any file could be in this directory so tempfile could solve this problem . i don't know the file so i can't copy file in flask…
Rome
  • 563
  • 1
  • 9
  • 25
1
vote
1 answer

Try to send a csv file but the permission fails

I'm trying to send a file (Intent.ACTION_SEND) but when I use for example gmail, the permission fail, and gmail notify me the permission of the attached file don't permit send it. Here is my code: private void LoadSendFile() { String temp =…
1
vote
1 answer

Rails send_file/send_data - Cannot Read File - After web service call

My Rails 3.1 app makes a web service call to get a pdf file that I then need to send to the browser for download. The XML response is something like this: blahblah this is the file info
user2967603
  • 139
  • 12
1
vote
0 answers

Send a file to server asp in android using http

Server side public class FileController : ApiController { public HttpResponseMessage PostFile() { var httpRequest = HttpContext.Current.Request; if (httpRequest.Files.Count > 0) { foreach (string file in…
Nguyễn Hoàng
  • 179
  • 1
  • 11
1
vote
1 answer

How can i upload file from console with other data

I would like to upload file to my web server. My server implement RESTful API. To upload file i should pass 4 parameters: file, file_name, project, version I would like to upload file with this 3 parameters from console. I tried this URL obj = new…
Oleh Kurpiak
  • 1,339
  • 14
  • 34