-
Notifications
You must be signed in to change notification settings - Fork 5
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
上传云存储,会报错 #6
Comments
你追踪下文件存放,找找问题所在。controller中返回的是临时文件,表单提交后复制临时文件到长久保存目录,所以是在Cropping.php中进行 |
跟踪过了,报错的原因 |
你的admin的上传配置是怎么样的 |
admin.php 配置是上传云的。所以 CroppingController.php 中直接上传到云存储,prepareInputValue() 函数应该都不用复写了。不过我本地没发现调用 CroppingController.php ,还是BASE64,但服务器是直接调用了。 |
你测试过了本地可以? |
我没有看前端代码,觉得裁切后,直接AJAX调用 CroppingController.php 上传,返回文件地址后就无需任何处理了。我现在本地走的 服务器值是云存储的地址,就没有做任何处理 (else的代码删掉了) |
刚才是了下,云存储也没有问题 |
你检查下云存储的配置 |
你有加入dcat-admin的qq或者微信的话可以在里面找我 |
一群已经满了,可加我Q 9816396 啊 |
在CroppingController文件中,有这么一句
$filename = Storage::disk(config('admin.upload.disk'))->putFile('weiwait/cropper', $request->file('file'));
然后上传云存储,
在 Cropping.php中
} elseif (str_starts_with($file, 'weiwait/cropper')) { $storage = Storage::disk(config('admin.upload.disk')); $cached = $storage->get($file); //...... }
文件提示找不到,只好把整段ELSE删除。
看这段 else 是上传 weiwait 的临时文件然后删除吗? 那为何不直接在 controller 中
$filename = Storage::disk(config('admin.upload.disk'))->putFile(config('admin.upload.directory.image'), $request->file('file'));
The text was updated successfully, but these errors were encountered: