hetalpatel's avatar

i want to upload vector file (.ai extention file)

i want to upload .ai extention file, and i use intervation for this bt still not uploaded,it store any type of file bt not upload .ai file and here is no size issue max size is 50mb and i want to upload 8mb .ai file here is my function

public function store(Request $request)
 {
    
try{
     if($request->hasFile('file')){
        $imagemodel= new Photo();
        $image = $request->file('file');
        // $filename = time() . '.' . $image->getClientOriginalExtension();
        $originalname = $image->getClientOriginalName();
        Image::make($image)->resize(300, 300)->save( public_path('images/' . $originalname));
        $imagemodel->photo_name = $originalname;
        $imagemodel->save();
        return back()->with('success', 'Image Upload successfully');
      }

}catch(Exception $e){
    return $e->getMessage();
}

}
0 likes
4 replies
hetalpatel's avatar

yaaa bt without using intervention it also dont allow me to upload .ai file i try to uploaded psd,svg, file all are uploaded succesfully without using intervention bt not . ai file if you have any solution please tell me

vandan's avatar

@hetalpatel change this line may be its will works

$originalname = $image->getClientOriginalName();
Image::make($image)->resize(300, 300)->save( public_path('images/' . $originalname));

To

$originalname = str_random(30).'.'.$image->getClientOriginalExtension();
    $image->move(public_path().'/images/',$originalname);
vandan's avatar

@hetalpatel i think your image should not proper that's why not upload change your image and try again

Please or to participate in this conversation.