GetResource with asp.net / C # does not find file
GetResource with asp.net / C # does not find file even though public_id is correct.
public static void CloudinaryFileInfos(Account account, string public_id)
{
Cloudinary cloudinary = new Cloudinary(account);
var getResourceParams = new GetResourceParams(public_id) { };
GetResourceResult result = cloudinary.GetResource(getResourceParams);
}
-
Hi,
One possible scenario is that you're trying to find a video file while the `GetResource` method defaults to Image. If that's the case, then please use the 'Video' ResourceType, like this:var getResourceParams = new GetResourceParams()
{
public_id,
ResourceType = ResourceType.Video
};
If that isn't the case, then it would be helpful if you'll share more information about the request, such as cloud_name, public_id so we could check your logs. If you'd like to keep it private, then please feel free to open a support ticket and we'll gladly help further.0 -
Integrating the folder in public_id helps. Thanks very much. Suggestion: Offer parameter folder at GetResource, Destroy, ... at asp.net.
0 -
Hi,
Thanks for the feedback - I responded to your other comment about this, but for the benefit of others reading this, the 'folder' parameter is primarily applicable to the upload API where you may want to add a file to a specific folder, then specify another method of naming the file. In other cases, including our API responses and webhooks notication payloads, the public_id value should be preserved, and this includes the folder path: https://cloudinary.com/documentation/image_upload_api_reference#sample_responseRegards,
Stephen
0
Post is closed for comments.
Comments
3 comments