データ変換ツール
https://hogehoge.tk/tool/
リクエスト
{"image": "data:image/jpeg;base64,{Base64データ}"}
{"movie": "data:video/mp4;base64,{Base64データ}"}
public function imageFileTempUpload(Request $request) { // 画像保存 \Log::debug($request->image); $image = $request->input("movie"); // your base64 encoded $image = str_replace('data:image/jpeg;base64,', '', $image); $image = str_replace(' ', '+', $image); $imageName = str_random(10).'.'.'jpeg'; \File::put(storage_path(). '/' . $imageName, base64_decode($image)); } public function movieFileTempUpload(Request $request) { // 動画保存 \Log::debug($request->movie); $movie = $request->input("movie"); // your base64 encoded $movie = str_replace('data:video/mp4;base64,', '', $movie); $movie = str_replace(' ', '+', $movie); $movieName = str_random(10).'.'.'mp4'; \File::put(storage_path(). '/' . $movieName, base64_decode($movie)); }