Are you sure it's an image file? Use laravel validation to ensure it's a file and an image
Jul 4, 2022
5
Level 1
Laravel ImageKit.io error
I tried uploading my image to imageKit.io platform, it successfully upload but its a broken image and if you get the url , it always show 404. my code below
$imageKit = new ImageKit(
"public_URL",
"private_URL",
"image.io_URL"
);
// For File Upload
$uploadFile = $imageKit->uploadFile([
'file' => $request->file('image'),
'fileName' => 'new-file'
]);
ddd($uploadFile);
After i upload it, i get the response below with a fileType showing non-image
ImageKit\Utils\Response {#1308 ▼
+err: null
+success: {#1331 ▼
+"fileId": "62c2c202afc5d35c08010892"
+"name": "new-file_TxaO4DK_Q"
+"size": 14
+"versionInfo": {#1329 ▶}
+"filePath": "/new-file_TxaO4DK_Q"
+"url": "https://ik.imagekit.io/ycwiiy2r8a/new-file_TxaO4DK_Q"
+"fileType": "non-image"
+"AITags": null
}
}
How do i get the image to display properly, if i copy the url to browser, it shows 404, if i check the platform dashboard, it gets uploaded as a broken image file
Please or to participate in this conversation.