alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1k stars 234 forks source link

Best Approach using Easy2 when uploading large files (Gigabytes) #516

Closed LorenzoLeonardo closed 8 months ago

LorenzoLeonardo commented 11 months ago

Hello what will be the best approach in using Easy2 especially uploading huge files? https://docs.rs/curl/latest/curl/easy/struct.Easy2.html#method.post_fields_copy

sagebind commented 10 months ago

The best way would usually be to implement read or to provide a read_function, both of which correspond to CURLOPT_READFUNCTION. This allows you to stream bytes from a large data source in a streaming fashion.