よく読まない子でスイマセン・・・。if($mimetype ne ’application/jpg’){$msg = ’ファイルタイプがマッチしません。’;を$msg = $mimetype;としてみると原因がわかるかも。