This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

transferring multiple files but some cannot open  RSS feed

 
shen zhang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi expert greenhorns:

I have a problem when i transfer files in different format, some files can open nicely, some cannot. For those cannot open normally, it shows some problems with content, that is why it cannot be opened. Thus i want to know how do i solve the problem. By the way, i actually do not have any problem to run the program in my server and client.
 
shen zhang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello? anyone can help?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "transfer" mean? How are you doing that? Have after the transfer all files the same size as before? Are you taking care to transfer in binary mode, not ASCII, if applicable? TellTheDetails.
 
shen zhang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What does "transfer" mean? How are you doing that? Have after the transfer all files the same size as before? Are you taking care to transfer in binary mode, not ASCII, if applicable? TellTheDetails.

using server and client. my coding is running well, but sometimes I cannot open some files because they said the content has interrupted. Other thing I noticed that sometimes my first file size is less 1kb than the original one, then the next file is more 1 kb than original. where am I wrong? I will upload my code
 
shen zhang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What does "transfer" mean? How are you doing that? Have after the transfer all files the same size as before? Are you taking care to transfer in binary mode, not ASCII, if applicable? TellTheDetails.


server side


Client


if you run the code, you will reliezed that normally the first file is ok, then after some files cannot be open normally. Please let me know where am I wrong
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Other thing I noticed that sometimes my first file size is less 1kb than the original one, then the next file is more 1 kb than original.

That would explain the corrupted files. If you find a set of files for which that happens, use those as test cases to debug the code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!