I am trying to copy data selectively from one Minio server to another with a c# windows application.
Data is downloaded OK, no exceptions occur, but file size in destination server is zero.
A little bit simplified, my source code is something as follows:
await source_client.GetObjectAsync("bucket", "path/from/file", async (stream) =>
{
using (MemoryStream memoryStream = new MemoryStream())
{
memoryStream.Position = 0;
await stream.CopyToAsync(memoryStream);
await destintation_client.PutObjectAsync("bucket", "path/to/file", memoryStream, memoryStream.Length);
}
});
I use the MemoryStream to buffer all data downloaded from source server in memory before uploading it to destination server.
I have checked with a breakpoint that data is downloaded correctly and that memoryStream.Length is not zero.
Both servers are tested and work correctly.
However, after the process, I see that destination server has the desired number of files, but all with zero size.