audio/mp3
,而是application/octet-stream
,这导致验证失败:$validator = Validator::make(
array('trackfile' => Input::file('trackfile')),
array('trackfile' => 'required|mimes:mp3')
);
if($validator->fails())
return 'doesn\'t works because mime type is '.Input::file('trackfile')->getMimeType();
else
return 'it works!';
为什么它不将文件上传为
audio/mp3
格式?(我已经在表单声明中添加了'files' => true
)
array('trackfile' => Input::file('trackfile'))
是用来做什么的? - The Alphaarray('trackfile' => Input::file('trackfile')
。 - The AlphaInput::file('trackfile')
,它会告诉我它期望一个数组而不是一个对象。 - ryanceymime_content_type
无法准确识别mp3
文件。 - The Alpha