z-song / laravel-admin

Build a full-featured administrative interface in ten minutes
https://laravel-admin.org
MIT License
11.15k stars 2.82k forks source link

上传图片/文件时错误,帮忙解答一下 #720

Closed y451309839 closed 7 years ago

y451309839 commented 7 years ago

上传后在文件保存目录有生成文件,跟踪代码时发现 Form/Field/Image::uploadAndDeleteOriginal 最后调用 destroy 时local驱动的delete方法获取不到this->original,上传失败!

laravel:5.1 laravel-admin 1.1.x-dev

不知道是不是配置里遗漏了什么,帮忙解答一下。。。

filesystem.php `'disks' => [

    'local' => [
        'driver' => 'local',
        'root'   => storage_path('app'),
    ],

    'admin' => [
        'driver' => 'local',
        'root' => public_path('upload'),
        'visibility' => 'public',
    ],

]`

admin.php

` 'upload' => [

    'disk' => 'admin',

    'directory'  => [
        'image'  => 'image',
        'file'   => 'file',
    ],

    'host' => 'http://meinv.com/upload/',

],`

返回异常 FileNotFoundException in Filesystem.php line 385: File not found at path: in Filesystem.php line 385 at Filesystem->assertPresent('') in Filesystem.php line 234 at Filesystem->delete(null) in FilesystemAdapter.php line 155 at FilesystemAdapter->delete(null) in File.php line 179 at File->destroy() in File.php line 89 at File->uploadAndDeleteOriginal(object(UploadedFile)) in Image.php line 33 at Image->prepare(object(UploadedFile)) in Form.php line 485 at Form->prepareInsert(array('name' => '', 'source_action' => '0', '_token' => 'Xg1So1nIFBrXJMnMmqgt3FCHhSI5Pss2rQb6ICOd', 'source' => object(UploadedFile))) in Form.php line 256 at Form->Encore\Admin{closure}(object(MySqlConnection)) in Connection.php line 476 at Connection->transaction(object(Closure))

edwinhuish commented 7 years ago

1.1 很久没有维护了吧? 有bug正常

y451309839 commented 7 years ago

又看了下文档,给跪了。。。 _20170406105346