In my program I was able to upload a photo with my API (NET Core) including a folder name. So my photo public id is in a format of 'myfoldername/photo_publicId'. when trying in postman to run my api that is responsible to change the default photo in my page, it is giving me the error 'not found' and I am guessing that is because it is treating the public_id as a path since it is including a folder name so it looks like a path 'foldername/photo_publicID'. http://localhost:5180/api/property/set-primary-photo/10/foldername/w7x3khvk9dny5xccr7jp where 10 is my property id and 'foldername/w7x3khvk9dny5xccr7jp' is my full photo_public_id. how to deal with this issue? Is this issue only for postman? Will it work if implemented in frontend app component? here is the code to upload:
public async Task UploadPhotoAsync(IFormFile photo, string folder)
{
var uploadResult = new ImageUploadResult();
if(photo.Length > 0)
{
using var stream = photo.OpenReadStream();
var uploadParams = new ImageUploadParams
{
File = new FileDescription(photo.FileName, stream),
//Folder = folder,
Transformation = new Transformation().Height(500).Width(800)
};
uploadResult = await cloudinary.UploadAsync(uploadParams);
}
return uploadResult;
}