Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For upload, consider using [NSMutableURLRequest setHTTPBodyStream] instead of setHTTPBody #37

Open
martin-gearzero opened this issue Jan 6, 2016 · 0 comments

Comments

@martin-gearzero
Copy link

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.

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

@tocker tocker removed their assignment Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants