Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-14-2008, 03:02 PM
Member
 
Join Date: Sep 2008
Posts: 37
Rep Power: 0
shwein is on a distinguished road
Default client-server app
hey, im a newbie with programming and im working on a networking program.
question: what stream should i use for sending a file from a client to a server app ?
example;
File file = filechooser.getSelectedFile();
i want to send file to my server app...
thx
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 10-14-2008, 03:48 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
Default
Is the file bytes or characters? There are different classes depending on which. Characters can go thru a conversion.
Use an OutputStream for bytes and a Writer for characters
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-14-2008, 04:58 PM
Member
 
Join Date: Sep 2008
Posts: 37
Rep Power: 0
shwein is on a distinguished road
Default
suppose i want to send all kinds of files(audio(bytes?),text(char?),...), depending on the user's choise, should i make object from/for these files(if yes, then how?) before i can send them to the client?
thx
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-14-2008, 06:20 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
Default
Not sure what "make object" means.
To access files on disk,you must use some kind of file object to read them.

If you read bytes and write bytes on both ends, the output file on the client should be the same as the input file on the server.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagram Client and Server, client timer question saru88 Networking 1 10-05-2008 04:12 PM
Server not able to connect client Kapil Gupta New To Java 15 07-22-2008 05:09 AM
client/server palindrom Rgfirefly24 New To Java 0 04-28-2008 03:19 AM
Identify Client in Socket Client Server Application masadjie Networking 1 12-20-2007 10:18 AM
Problems with client and server Albert Advanced Java 2 07-02-2007 07:07 AM


All times are GMT +2. The time now is 09:33 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org