上传文件时通过AJAX更新列表
I have a problem. When a user uploads a file it goes in a filesystem and the filename is being uploaded in DB. After uploading the file, the user should see in a list all his filenames including the new uploaded file. All this should be done without reloading the page. I got everything fine except this auto refresh list. I'm using Laravel and Dropzone.js. This is the route
我有个问题。当用户上传文件时,它会进入文件系统,文件名将被上传到DB中。上传文件后,用户应在列表中看到他的所有文件名,包括新上传的文件。所有这些都应该在不重新加载页面的情况下完成。除了这个自动刷新列表,我得到了一切。我正在使用Laravel和Dropzone.js。这是路线
Route::get('/', function () {
return View::make('index')->with('files', DB::table('files')->select('filename')->get()) });
And here I loop all the results
在这里我循环所有结果
@foreach($files as $file)
<li>{{ $file->filename }}</li>
@endforeach
And the problem as I said is updating the list with the new uploaded name withould refreshing the page
我说的问题是使用新上传的名称更新列表并刷新页面
1 个解决方案
#1
0
After uploading a file, you need to append a new <li>
to your list with the new filename.
上传文件后,您需要使用新文件名将新的
更多相关文章
- PHP上传文件 Error 6解决方法
- 使用ASIHTTPRequest从iOS上传图像
- 【ecmall】解决无法上传店铺logo和banner照片问题
- PHP 使用 OSS 批量上传图片
- 用于上传多个文件的PHP代码
- php图片上传并重命名图片的功能实现原理
- php读取目录及子目录下所有文件名的方法
- 使用没有后端脚本的Angularjs上传文件(例如PHP,JAVA等)
- JS获取文件名的方法