2017-09-13 17 views
0

검색 한 결과이 문제에 대한 답을 찾지 못했습니다.Intervention 업데이트시 이미지 소스를 읽을 수 없습니다.

음, laravel 5.5에서 개입하여 사진을 업로드하고 있습니다. 내 조리법 (내 경우)이 create 인 경우 모두 작동하고 사진이 성공적으로 업로드되고 있습니다.

$front_image = $request->file('front_image'); 

$frontImageName = md5(time()) . '.' . $front_image 
        ->getClientOriginalExtension(); 

$locationfi = public_path('photos/front/' . $frontImageName); 

Image::make($front_image) 
    ->resize(454,340) 
    ->insert(public_path('photos/logo.png'),'bottom-right') 
    ->save($locationfi); 

$recipe->front = $frontImageName; 

모든 표준 재료 :

초기 업로드 코드입니다. 하지만 edit을 시도하면 Image source not readable이됩니다.

 $front_image = $request->file('front_image'); 

     $frontImageName = md5(time()).'.'.$front_image 
         ->getClientOriginalExtension(); 

     $location = public_path('photos/front/'.$frontImageName); 

     Image::make($front_image)->resize(690,517) 
      ->insert(public_path('photos/tk.png'),'bottom-right') 
     ->save($location); 

     //update the database 
     $recipe->front=$imageName; 

나는 두 가지 형태로 enctype="multipart/form-data"를 사용에 대한 생성 및 업데이트 : 이 재 업로드에 대한 코드입니다. 업데이트 양식에서 나는 {{method_field('PUT'}}도 사용합니다.

무엇이 여기에 있습니까? 감사.

+0

어떤 버전의 PHP를 사용하고 계십니까? –

+0

PHP 7을 사용하고 있습니다. @sunitiyadav – GabMic

답변

0

나는이 문제를 해결했다. "그것은 항상 사소한 일"이기 때문에 그들은 말한다. 로고 이미지를 삽입했을 때, 존재하지 않는 phtoto를 참조했습니다. 그게 분명히 저에게 오류를 줬던 이유입니다.