huhx / flutter_oss_aliyun

阿里云oss sdk的flutter版本
MIT License
61 stars 23 forks source link

option add content type #28

Closed johnhaha closed 1 year ago

johnhaha commented 1 year ago

currently file content type will always be application/octet-stream add content type field to PutRequestOption, so people can modify the content type according to the file

增加了可以自定义上传header的content-type,当前只能是application/octet-stream

huhx commented 1 year ago

感谢你的PR,提供了很有用的信息。基于你的PR,

  1. 我在PutRequestOption和CopyRequestOption里面添加了headers字段,让user可以更灵活的添加headers(包括content-type和aliyun上传时支持的headers)
  2. 对于content-type,首先是根据文件名来决定的,如果不能确定,默认就是application/octet-stream。此外PutRequestOption和CopyRequestOption的headers拥有更高的优先级

version: v5.2.0

johnhaha commented 1 year ago

Author offered a better solution!