0
0

More than 3 years have passed since last update.

Laravel PHP 送信されたファイルの拡張子をMIMEの情報から取得する

Posted at

目的

  • Postされた拡張子を取得する方法をまとめる

方法

  1. inputのnameでimageとしている場合に受け取るときに受け取り側のコントローラーに下記を記載する。

    $extensions = $request->file('image')->guessExtension();
    
  2. $extensionsにファイルの拡張子が格納される。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0