We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://support.huaweicloud.com/sdk-nodejs-devg-obs/obs_29_0404.html 只有文件的buffer流,怎么使用ObsClient 进行文件上传呢?总不能走一遍写入然后读取成功在删除吧。
The text was updated successfully, but these errors were encountered:
需要buffer转stream,然后再调用sdk的上传接口。可参考以下代码:
let Duplex = require('stream').Duplex; function bufferToStream(buffer) { let stream = new Duplex(); stream.push(buffer); stream.push(null); return stream; } const buffers = []; // 文件buffer const stream = bufferToStream(buffers); obsClient.putObject({ Bucket : bucketName, Key: 'objectname', Body: stream }).then(res => console.log(res));
Sorry, something went wrong.
No branches or pull requests
https://support.huaweicloud.com/sdk-nodejs-devg-obs/obs_29_0404.html
只有文件的buffer流,怎么使用ObsClient 进行文件上传呢?总不能走一遍写入然后读取成功在删除吧。
The text was updated successfully, but these errors were encountered: