我是Laravel的初学者。
我想在我的项目中使用此组件:https://github.com/UniSharp/laravel-filemanager
我有此文件系统磁盘:
'upload' => [
'driver' => 'local',
'root' => public_path('upload'),
'url' => env('APP_URL').'/upload',
],
我的lam.php:
<?php
return [
'use_package_routes' => true,
'allow_multi_user' => false,
'allow_share_folder' => false,
'files_dir' => '',
'folder_categories' => [
'file' => [
'folder_name' => 'txt///',
'startup_view' => 'grid',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
],
],
'image' => [
'folder_name' => 'photos',
'startup_view' => 'list',
'max_size' => 50000, // size in KB
'valid_mime' => [
'image/jpeg',
'image/pjpeg',
'image/png',
'image/gif',
'image/svg+xml',
'application/pdf',
'text/plain',
],
],
],
'disk' => 'upload',
'rename_file' => false,
'alphanumeric_filename' => true,
'alphanumeric_directory' => true,
'should_validate_size' => false,
'should_validate_mime' => true,
'create_folder_mode' => 0755,
'create_file_mode' => 0644,
'should_change_file_mode' => true,
'over_write_on_duplicate' => false,
'raster_mimetypes' => [
'image/jpeg',
'image/pjpeg',
'image/png',
],
'thumb_img_width' => 200,
'thumb_img_height' => 200,
'resize_aspectRatio' => true,
'resize_containment' => true,
'file_type_array' => [
'pdf' => 'Adobe Acrobat',
'doc' => 'Microsoft Word',
'docx' => 'Microsoft Word',
'xls' => 'Microsoft Excel',
'xlsx' => 'Microsoft Excel',
'zip' => 'Archive',
'gif' => 'GIF Image',
'jpg' => 'JPEG Image',
'jpeg' => 'JPEG Image',
'png' => 'PNG Image',
'ppt' => 'Microsoft PowerPoint',
'pptx' => 'Microsoft PowerPoint',
],
'file_icon_array' => [
'pdf' => 'fa-file-pdf-o',
'doc' => 'fa-file-word-o',
'docx' => 'fa-file-word-o',
'xls' => 'fa-file-excel-o',
'xlsx' => 'fa-file-excel-o',
'zip' => 'fa-file-archive-o',
'gif' => 'fa-file-image-o',
'jpg' => 'fa-file-image-o',
'jpeg' => 'fa-file-image-o',
'png' => 'fa-file-image-o',
'ppt' => 'fa-file-powerpoint-o',
'pptx' => 'fa-file-powerpoint-o',
],
'php_ini_overrides' => [
'memory_limit' => '256M',
],
];
我想将文件上传到public / upload / txt。
当文件上传到服务器时,它们保存在public / upload / txt / http // project1 /上载/ txt /
(路径错误)。
为什么会这样?如何解决?