Callisto82 / tftp.net

Implements the TFTP (Trivial File Transfer) protocol (client/server) in an easy-to-use C#/.NET library.
Microsoft Public License
80 stars 38 forks source link

Unable to get the copied file location. #13

Closed tr14466 closed 4 years ago

tr14466 commented 4 years ago

I am running the same code and line no. 21 of client Program.cs is client.Download("EUPL-EN.pdf"); I ran the server program first and then client program. There is a file in the server bin folder named as "EUPL-EN.pdf". Everything works fine and file transferred completed message shown in the console, but i didn't get the file in the client side. I have checked the bin folder of the client but the file is not there.

Another issue is when I am using client.Upload("EUPL-EN.pdf"); Then file transfer with 0 bytes.

Callisto82 commented 4 years ago

See these two lines in the sample: Stream stream = new MemoryStream(); transfer.Start(stream);

In the client.Download("...") - case, these lines just download the file to memory. Replace the stream with a FileStream to save it into a file. In the client.Upload("...") - case (your "another issue"), the same lines just upload an empty file from memory. Again, replace them with a real filestream if you want to upload an actual file.

tr14466 commented 4 years ago

See these two lines in the sample: Stream stream = new MemoryStream(); transfer.Start(stream);

In the client.Download("...") - case, these lines just download the file to memory. Replace the stream with a FileStream to save it into a file. In the client.Upload("...") - case (your "another issue"), the same lines just upload an empty file from memory. Again, replace them with a real filestream if you want to upload an actual file.

client.Upload() file length 2113220 byte, Return information is abnormal, How to deal with it? upload

client.Upload() file length 38912 byte, Return information is Ok. upload2

tr14466 commented 4 years ago

See these two lines in the sample: Stream stream = new MemoryStream(); transfer.Start(stream);

In the client.Download("...") - case, these lines just download the file to memory. Replace the stream with a FileStream to save it into a file. In the client.Upload("...") - case (your "another issue"), the same lines just upload an empty file from memory. Again, replace them with a real filestream if you want to upload an actual file.

1、 these lines just download the file to memory. Replace the stream with a FileStream to save it into a file. ——>Can be specific or provide code examples 2、eplace them with a real filestream if you want to upload an actual file.——>Can be specific or provide code examples Thanks