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

复制example.blade.php中<script>中代码到app..js中使用,出现“错误:上传发生错误" #87

Open
fine129 opened this issue Feb 29, 2020 · 5 comments

Comments

@fine129
Copy link

fine129 commented Feb 29, 2020

为了检验,完全是复制示例页面中script代码,我的blade页面只有一个input type-file 输入框。
但是即使这样运行,也是上传到94%左右出现这个”错误:上传发生错误“,然后进度条停止。
我分析了附带js文件的源码,专门搜索这个错误,但是没发现。example.blade.php中上传文件正常,复制到我的blade页面中就有错误。。。请大神说明!多谢。

@peinhu
Copy link
Owner

peinhu commented Mar 5, 2020

没人报告过这个错误,把example中的代码完全复制到你的blade文件中再试试?

@fine129
Copy link
Author

fine129 commented Mar 6, 2020

完全复制过去后,还是这个错误。在example页面正常,在自己建立的blade页面这个错误,二者区别在于我的blade页面不能有<script>标签,所以都转移到了app.js中,这样运行后,在example页面还是正常,但是我的页面就是这个上传发生错误。我仔细观察,二者另一个关键区别在于上传文件时,瞬间example页面有个正在hash进度条,完毕后才出现上传进度条。但是我的页面没有出现这个hash进度条,直接就是上传进度条。不过,虽然找到这个,但是没找到怎么修改,请大神指教,多谢:)

@peinhu
Copy link
Owner

peinhu commented Mar 6, 2020

spark-md5.min.js为必须,不是可选。另外,移入app.js的话静态文件的路径可能需要改一下,原来是在blade文件里的,路径包含php函数,在纯js文件中可能无法解析,把浏览器控制台调出来看看有没有静态文件加载失败的报错?

@fine129
Copy link
Author

fine129 commented Mar 6, 2020

感谢大神指教。添加spark-md5.js后,果然不报错了。上传正常。不过,分片上传不受php和nginx大小约束,但是正常上传却受到限制10M,我想调整后台限制,但是laradock调整很久,也无效。我接触laradock不久,很多地方弄不清楚,这个调整laradock后台限制大小的步骤,也请教大神了。。。多谢:)

@peinhu
Copy link
Owner

peinhu commented Mar 6, 2020

没用过laradock,理论上调整nginx.conf和php.ini中的相关设置就行了,自己搜一下网上有很多,改完记得重启nginx和php-fpm服务。

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

2 participants