Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:
JavaWorld Daily Brew

Send a file through a socket connection


Hi All,

I need to read a file using a server socket and send the file to a client socket and assemble the file at the clients end. I tried to do it several ways, but failed.

Can someone tell me how to do it. Specially assemble the bits at the clients end and recreate the file and assign to a file object.

Thanks.

Your rating: None Average: 3.7 (3 votes)

Socket connection

Go to this link and good luck.

http://www.example-code.com/java/javasocket.asp

The Client just makes a

The Client just makes a connection to the port specified on the local machine and writes the received bytes to a file as specified.

It was very helpful tutorial

It was very helpful tutorial thank you so much for sharing. This website is great.

It was very helpful tutorial

It was very helpful tutorial thank you do much for sharing.Mens swimwear

yes it was very helpful post

yes it was very helpful post i was facing some trouble with coding but this post saved my time.

It was very helpful post

It was very helpful post thank you so much for sharing knowledge.
Regards

Vintage Bicyckes

The post was very help ful

The post was very help ful for me thank you so much for sharing.

online games

Good approach. Some tweaks

Good approach. Some tweaks are required against:
1. hardcoded byte array size
2. infinite while loop instead of timertask

I Love Java and it was my

I Love Java and it was my favorite post.
Thank you so much for sharing.

It was very helpful tutorial

It was very helpful tutorial thank you do much for sharing.

Re:

Thank you so much for shaing interesting information.
Get Educated Scam

Ok i will check this

Ok i will check this linkCarbon Footsy

Helpful Information

It is really a helpful information.It helps me making my site much better. I use your ideas and they do a fantastic job.

Knowledgeable Article.

It is really helpful information. It can help in many things. JAVA World is really a huge platform. It is very knowledgeable. I like your working style and that is really good.

Knowledgeable Article.

It is really helpful information. It can help in many things. JAVA World is really a huge platform. It is very knowledgeable. I like your working style and that is really good.

JAVA World is a Huge world.

JAVA World is a Huge world of knowledge. It helps me so much in my work . And this article is really amazing.

Great article

It is really a helpful article for the people who are interested in networking. I like this so much. YOu guys are doing such a great work.

Helpful Article

It is really good. I like your work so much it is really great . It helps me to get more information about new inventions. And that is wonderful.

Nice Information

It is really helpful Information. You guys are doing such a moral work to share information.

It is really Helpful

Nice article. It is really helpful .It is a bundle of knowledge, I have no words to praise it. I t is mind blowing article.

Really Knowledgeable

This article is really knowledgeable. It helps to know the new programs. It gives information about new programs made by JAVA World. It is really amazing. Your article is really informative.

Really a good information.

It is really a good article. It is very helpful . It helps to know about new programs of java world and it is really great.

Great Information

It is really a nice information .It is really helpful .it has solved my big problem to transfer data.

or Live sports

Great Article

It is really a nice information .It is really helpful .it has solved my big problem to transfer data.

Great Idea

I like your idea. I m totally agreed with this. You guys are really doing a nice job. It is really a helpful information.

Great Information

I like your idea. I m totally agreed with this. You guys are really doing a nice job. It is really a helpful information.

IT is really helpful Article

This is really informative. It is really an amazing knowledge which you guys have shared with us. It is really helpful. It helps me in my many works. You guys are really doing a great work.

black tungsten rings

Very Informative Article

This is really an knowledgeable article. Your ideas and information is really helpful.It is really an good idea to serve data in very fast way.

tungsten carbide ring

Nice Information

This is really a helpful article.It is very informative.It has solved many problems which we normally facing when we transferring data. it is really a great information.

auto insurance comparison

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <p> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br /> <br> <strike>
  • Lines and paragraphs break automatically.
  • Use <!--pagebreak--> to create page breaks.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
Just checking to see if you're an actual person rather than a spammer. Sorry for the inconvenience.