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

put方式文件上传文件类型的判定bug #1216

Closed
jockiech opened this issue Jun 25, 2023 · 0 comments
Closed

put方式文件上传文件类型的判定bug #1216

jockiech opened this issue Jun 25, 2023 · 0 comments

Comments

@jockiech
Copy link

我在使用富文本组件粘贴图片自动通过ali-oss/nodejs-sdk中的put api进行上传时遇到这个错误【Must provide Buffer/Blob/File for put.】。在源码中发现抛出错误的原因是因为isFile函数和isBlob函数的返回值均为false,它是通过instanceof来进行类型判定,但这个类型判定的结果受执行上下文环境影响。目前情况就是我这里正常走上传流程没有问题,但是图片粘贴生成的文件流做上传就会遇到这个问题。不知这里为什么没有考虑使用Object.prototype.toString.call()进行类型判定?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant