John Davidson

Upload image in specific folder php Cloudinary


I'm trying to upload images to folders in my cloudinary account but I can't get it to work, it always saves to the default home folder.

I have two folders in there called categories and products.

This is what I have right now

$options = array('public_id' => '/home/categories/' . $request->name . '.' .$extension)

I also did '/categories/' . $request->name . '.' .$extension

I get this

public_id (/home/categories/asdasdf.jpg) is invalid

The docs are here, I can't see what I'm doing wrong

How can I fix this?

My Answer:
array("folder" => "categories")

I want to upload the image to the categories folder but it's not working. Can someone help me with the correct code to upload an image to a specific folder in Cloudinary using PHP?

Rate this post

3 of 5 based on 3910 votes


© 2024 - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us