\'required|file|mimes:ppt,pptx,doc,docx,pdf,xls,xlsx|max:204800\', ]); ...' />
欢迎光临
感谢一路有你

laravel 上传验证

单个
$request->validate([
    'document' => 'required|file|mimes:ppt,pptx,doc,docx,pdf,xls,xlsx|max:204800',
]);


多个
$request->validate([
    'document.*' => 'required|file|mimes:ppt,pptx,doc,docx,pdf,xls,xlsx|max:204800',
]);



D:\phpStudy\WWW.FAN300.COM\xxx\vendor\swiftmailer\swiftmailer\lib\swiftmailer_generate_mimes_config.php

 $valid_mime_types_preset = [
      'php' => 'application/x-php',
      'php3' => 'application/x-php',
      'php4' => 'application/x-php',
      'php5' => 'application/x-php',
      'zip' => 'application/zip',
      'gif' => 'image/gif',
      'png' => 'image/png',
      'css' => 'text/css',
      'js' => 'text/javascript',
      'txt' => 'text/plain',
      'aif' => 'audio/x-aiff',
      'aiff' => 'audio/x-aiff',
      'avi' => 'video/avi',
      'bmp' => 'image/bmp',
      'bz2' => 'application/x-bz2',
      'csv' => 'text/csv',
      'dmg' => 'application/x-apple-diskimage',
      'doc' => 'application/msword',
      'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
      'eml' => 'message/rfc822',
      'aps' => 'application/postscript',
      'exe' => 'application/x-ms-dos-executable',
      'flv' => 'video/x-flv',
      'gz' => 'application/x-gzip',
      'hqx' => 'application/stuffit',
      'htm' => 'text/html',
      'html' => 'text/html',
      'jar' => 'application/x-java-archive',
      'jpeg' => 'image/jpeg',
      'jpg' => 'image/jpeg',
      'm3u' => 'audio/x-mpegurl',
      'm4a' => 'audio/mp4',
      'mdb' => 'application/x-msaccess',
      'mid' => 'audio/midi',
      'midi' => 'audio/midi',
      'mov' => 'video/quicktime',
      'mp3' => 'audio/mpeg',
      'mp4' => 'video/mp4',
      'mpeg' => 'video/mpeg',
      'mpg' => 'video/mpeg',
      'odg' => 'vnd.oasis.opendocument.graphics',
      'odp' => 'vnd.oasis.opendocument.presentation',
      'odt' => 'vnd.oasis.opendocument.text',
      'ods' => 'vnd.oasis.opendocument.spreadsheet',
      'ogg' => 'audio/ogg',
      'pdf' => 'application/pdf',
      'ppt' => 'application/vnd.ms-powerpoint',
      'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
      'ps' => 'application/postscript',
      'rar' => 'application/x-rar-compressed',
      'rtf' => 'application/rtf',
      'tar' => 'application/x-tar',
      'sit' => 'application/x-stuffit',
      'svg' => 'image/svg+xml',
      'tif' => 'image/tiff',
      'tiff' => 'image/tiff',
      'ttf' => 'application/x-font-truetype',
      'vcf' => 'text/x-vcard',
      'wav' => 'audio/wav',
      'wma' => 'audio/x-ms-wma',
      'wmv' => 'audio/x-ms-wmv',
      'xls' => 'application/vnd.ms-excel',
      'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
      'xml' => 'application/xml',
  ];

赞(0) 打赏
未经允许不得转载:王明昌博客 » laravel 上传验证
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

隐藏
变装