Laravel 数据上传进度条
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36796119/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel Progress bar for data upload
提问by John Does Legacy
I am using laravel 5.1
我正在使用 Laravel 5.1
I want to create a progress bar based on how long the file takes to upload.
我想根据文件上传所需的时间创建一个进度条。
I have multiple input fields and want to upload / get a progress bar on my submit button.
我有多个输入字段,想在我的提交按钮上上传/获取进度条。
What would be the best (or good) approach of doing this.
这样做的最佳(或好的)方法是什么。
I basically have a form and already upload some file in the database.
我基本上有一个表单并且已经在数据库中上传了一些文件。
But I do not know how to create a upload progressbar based on this.
但我不知道如何基于此创建上传进度条。
回答by Giacomo Torricelli
I think the best way is to use a library like this one:
我认为最好的方法是使用这样的库:
回答by andrew-caulfield
I'd probably use something like Dropzone js
我可能会使用 Dropzone js 之类的东西
It would give you the added extra functionality of allowing you to drag and drop files into an upload area. Also allowing for multiple file uploads.
它将为您提供额外的功能,允许您将文件拖放到上传区域。还允许多个文件上传。