• Post Reply Bookmark Topic Watch Topic
  • New Topic

Sending file name  RSS feed

 
Sophie Jo
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sending a file via tcp/ip it's a combo of a ftp program and a tcp.ip program. I have no errors.

However i would like to send the file name, as a String, without the path to the client. e.g c:\my doc\a.txt i would like it to be sent as a.txt.

I tried using a loop, but aside from the logical errors that incurrs, when the data is read out there is still a 'null' value infront of it.

Is there another way?

Would be greatful for any ideas.

Thanks.
[ May 16, 2004: Message edited by: Sophie Jo ]
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try sending to the OutputStream, first a long for the length of the file, then a short for the length of the file name, then the bytes for the name of the file, and finally bytes that are the actual file content.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!