-
Notifications
You must be signed in to change notification settings - Fork 31
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
direct_upload在rails 6.1下有问题 #70
Comments
我在测试里面试了一下,没重现出来 |
我尝试运行了你的代码
选择并上传avatar和files后提示错误: 检查阿里云oss发现avatar上传成功,files的上传全部失败。 检查了项目本身发现tmp/storage目录下,出现了direct_upload上传的files文件。说明 我还找到了Rails上关于这个问题的issue和pr目前看来,问题出在Rails本身上了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
操作一
Rails 6.1中,对active storage,在模型中增加了service新的配置方法,例如:
development.rb中,未做修改,保持了默认
非direct_upload文件时,可以正常上传到阿里云oss
使用direct_upload传文件时,依然上传到本地,而不是阿里云oss上。也就说模型中配置的service,根本没有生效。
chrome的netwok中,看不到请求阿里云oss的记录。
操作二
模型中,不配置service
development.rb中,修改为:aliyun
再次测试direct_upload文件,可以正确上传到阿里云oss了。
chrome的netwok中,也可以看到请求阿里云oss的记录。
结论:
初步判断,
我不确定是Rails的问题,还是activestorage-aliyun的问题?
The text was updated successfully, but these errors were encountered: