SeanK
SeanK
CDCloudflare Developers
Created by ermiya on 12/10/2023 in #general-help
`CopyObject` S3 compatibility
I did another test and it's not the nesting that's the problem, it's the type of file (.ts which I'm sure I could sort out by setting the right content type somewhere). I can transfer a m3u8 text file nested without issues so Min.io is a solid workaround as suggested.
38 replies
CDCloudflare Developers
Created by ermiya on 12/10/2023 in #general-help
`CopyObject` S3 compatibility
I tried Min.io .net client which works if you have no nesting in your copy: var srcArgs = new CopySourceObjectArgs().WithBucket("sourceBucket").WithObject("file.txt"); var copyArgs = new CopyObjectArgs().WithBucket("targetBucket").WithObject("file.txt").WithCopyObjectSource(srcArgs); await minioClient.CopyObjectAsync(copyArgs); But this fails: var srcArgs = new CopySourceObjectArgs().WithBucket("sourceBucket").WithObject("folder/file.txt"); var copyArgs = new CopyObjectArgs().WithBucket("targetBucket").WithObject("folder/file.txt").WithCopyObjectSource(srcArgs); await minioClient.CopyObjectAsync(copyArgs); As an alternative, what I ended up doing is running rclone inside a process: var psi = new ProcessStartInfo(); psi.FileName = "C:\pathToRClone\rclone.exe"; psi.Arguments = "connection:sourceBucket/folder/file.txt connection:targetbucket/folder"; psi.RedirectStandardError = true; psi.UseShellExecute = false; var process = Process.Start(psi); var standardErrorTask = process.StandardError.ReadToEndAsync(); var internalTimeOut = TimeSpan.FromHours(1); var timeoutSignal = new CancellationTokenSource(internalTimeOut); try { await process.WaitForExitAsync(timeoutSignal.Token); var standardError = await standardErrorTask; if (process.ExitCode != 0) { throw new Exception($"Proccess failed. Exit Code {process.ExitCode}. StdError {standardError}"); } } catch { process.Kill(); process.WaitForExit(); throw; }
38 replies