# Any one help me?

**URL:** <https://www.ruby-forum.com/t/any-one-help-me/118280>\
**Category:** Ruby\
**Created:** [October 25, 2007, 11:03am UTC](https://www.ruby-forum.com/t/any-one-help-me/118280 "2007-10-25T11:03:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vellingiri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Post date:** [October 25, 2007, 11:03am UTC](https://www.ruby-forum.com/t/any-one-help-me/118280/1 "2007-10-25T11:03:49Z")

</div>

Dear friends,  
I am unable to findout the answers for this question?  
I am having one server socket program ans one client program.  
server program:  
\<----------------\>  
\<-----------------\>

./server.rb -p 1234

client program:  
\<------------------\>  
\<------------------\>

./client.rb -p 1234

Now I want to send one file to client that is available in current  
directory.  
Both the client and server is runnig under this  
directory[vellingiri@fountserver].  
Thsi is having some files ,for instance,

1.rb 2.rb 3.rb 4.rb sserver.rb client.rb

Is there any method to send a one file from client to server.Please  
could anybody tell me.  
In c we are using the sendfile library function,same way in ruby is  
there any way.

by  
Vellingiri

---

<div class="post-metadata">

**Author:** ![vellingiri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Post date:** [October 26, 2007, 1:34am UTC](https://www.ruby-forum.com/t/any-one-help-me/118280/2 "2007-10-26T01:34:01Z")

</div>

> Is there any method to send a one file from client to server.Please  
> could anybody tell me.  
> In c we are using the sendfile library function,same way in ruby is  
> there any way.
> 
> by  
> Vellingiri

[http://rubyforge.org/projects/ruby-sendfile](http://rubyforge.org/projects/ruby-sendfile)

---

<div class="post-metadata">

**Author:** ![vellingiri](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/5fc32e/32.png) [@vellingiri](https://www.ruby-forum.com/u/vellingiri)\
**Post date:** [October 25, 2007, 1:10pm UTC](https://www.ruby-forum.com/t/any-one-help-me/118280/3 "2007-10-25T13:10:46Z")

</div>

On 10/25/07, Arul hari [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<------------------\>  
> 1.rb 2.rb 3.rb 4.rb sserver.rb client.rb
> 
> Is there any method to send a one file from client to server.Please  
> could anybody tell me.  
> In c we are using the sendfile library function,same way in ruby is  
> there any way.

If you are using EventMachine library for instance for writing server,  
then it does offer a method send\_file\_content for sending files across  
network. Otherwise, I suppose, you can stream the file over the  
socket. Or else, there might be bindings for sendfile library in ruby.

–  
Let them talk of their oriental summer climes of everlasting  
conservatories; give me the privilege of making my own summer with my  
own coals.

[http://gnufied.org](http://gnufied.org)
