大家好,我使用Windows在路径中保存图像时遇到错误。
我遇到了类似的错误 在 EventController.php 行219
handleError(8,'Undefined offset:1', 'D:\ Lakuin \ var \ www \ html \ lakuin1.3 \ app \ Http \ Controllers \ App \ EventController.php', 219,
我已经在laravel上为事件图像设置了公共文件夹
$uploadfile = $dir."/eventsimage_" . $image_sha1 . ".png";
$uploadfile_s3 = "/eventsimage_" . $image_sha1 . ".png";
$namedb = $dirdb."/eventsimage_" . $image_sha1 . ".png";
$explodedData = explode(',', $request->eventsimage);
//file_put_contents(base_path().'/'.$uploadfile, base64_decode($explodedData[0]));
file_put_contents(base_path() . '/' . $uploadfile, base64_decode($explodedData[1]));
$eventsimage = $namedb;
Storage::disk('spaces')->put('/events/'.$events[0]->start_date.$uploadfile_s3, base64_decode($explodedData[0]), 'public');
$url = Storage::disk('spaces')->url('events/'.$events[0]->start_date.$uploadfile_s3);
我希望我可以使用此代码。