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.

上传文件后,您需要使用新文件名将新的

  • 附加到列表中。

  • 更多相关文章

    1. PHP上传文件 Error 6解决方法
    2. 使用ASIHTTPRequest从iOS上传图像
    3. 【ecmall】解决无法上传店铺logo和banner照片问题
    4. PHP 使用 OSS 批量上传图片
    5. 用于上传多个文件的PHP代码
    6. php图片上传并重命名图片的功能实现原理
    7. php读取目录及子目录下所有文件名的方法
    8. 使用没有后端脚本的Angularjs上传文件(例如PHP,JAVA等)
    9. JS获取文件名的方法

    随机推荐

    1. MyBatis之Mapper XML 文件详解(三)-Resul
    2. 为什么不推荐使用finalize方法,来看看对垃
    3. MyBatis之Mapper XML 文件详解(二)-sql和
    4. 一个简单的案例帮你理解什么是SpringIOC(
    5. MYSQL认证
    6. Python对比其他语言有什么优劣势?
    7. 对职业生涯的思考
    8. 国内技术氛围到底怎么样呢
    9. Springboot整合mybatis多数据源(注解完整
    10. 帮你解读什么是Redis缓存穿透和缓存雪崩