GitHub user videni added a comment to the discussion: How to use opendal to
implement breakpoint resume upload and Incremental upload ?
Following the official example , it seems there is no need to init multipart
upload manually. It happens magically. But we want the client to continue the
last upload. We may need to keep the upload id, how can we get the upload id
please?
# Question 2,
```
async fn example(op: Operator) -> opendal::Result<()> {
let mut w = op.writer("test.txt").await?;
// Write a 10MiB chunk.
w.write(vec![0; 10 * 1024 * 1024]).await?;
println!("vec![0; 10 * 1024 * 1024] uploaded");
// Write another 10MiB chunk.
w.write(vec![1; 10 * 1024 * 1024]).await?;
println!("vec![1; 10 * 1024 * 1024] uploaded");
// Finish the upload.
w.close().await?;
println!("upload finished");
let bs = op.read("test.txt").await?;
println!("read: {} bytes", bs.len());
assert_eq!(
bs.to_vec(),
vec![0; 10 * 1024 * 1024]
.into_iter()
.chain(vec![1; 10 * 1024 * 1024])
.collect::<Vec<_>>()
);
Ok(())
}
```
GitHub link:
https://github.com/apache/opendal/discussions/5875#discussioncomment-12610628
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]