cloudinary / cloudinary/cloudinary_ios
For upload, consider using [NSMutableURLRequest setHTTPBodyStream] instead of setHTTPBody
- Dominant language
- Swift
- Stars
- 169
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
Description
Hi there,
I wanted to make a quick suggestion.
Cloudinary can use a significant amount of memory, particularly when uploading videos or large photos because image/video data must be fully loaded into RAM before being sent over the wire.
It looks as though NSMutableURLRequest supports setting an body stream instead of data.
``` obj-c
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
NSInputStream *stream = [[NSInputStream alloc] initWithFileAtPath:filePath];
[request setHTTPBodyStream:stream];
```
This might be something worth looking into to reduce Cloudinary's memory footprint.
Thanks,
Martin
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.