Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@martin-gearzero

Description

@martin-gearzero

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions