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

未关闭
#37 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
ios, objective-c
领域
mobile

调研方向

首先找到当前使用 setHTTPBody 分配上传数据的 iOS 上传请求实现,然后检查文件和视频上传是如何构造的。将现有请求流程与 NSMutableURLRequest 的 setHTTPBodyStream 进行比较,并确定完成处理和错误处理的工作方式。完成的标准是:大文件上传不再需要将完整 payload 保存在内存中,同时不破坏现有上传功能。

由索引模型根据 Issue 内容生成。

描述

enhancement

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

主要语言
Swift
星标
169
派生
107
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudinary/cloudinary_ios 的其他 Issue

查看 cloudinary/cloudinary_ios 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。