How to upload with out version in folder structure?
So say I want the url to be /myaccount/image/upload/photourl.jpg
-
Including the version component in URLs is actually optional. For example...
Sample image with the version component:
http://res.cloudinary.com/demo/image/upload/v1312461204/sample.jpg
Sample image with the version component removed:
http://res.cloudinary.com/demo/image/upload/sample.jpg
The version component is useful for bypassing CDN cache if you happen to overwrite an existing image and you want to ensure that your users get the latest version. For more info on versions, feel free to check out this documentation:
http://cloudinary.com/documentation/upload_images#image_versions
1 -
How do we remove the verson from result
{
asset_id: 'eb1c25eba9753f5e74e07bb392fe5d20',
public_id: 'hti9ug6hafzn7q62fi0l',
version: 1606473662,
version_id: 'f91f576b305fc4133378c4621f0367ab',
signature: 'd645450cd6aefb1a3233615d0762468a930f23e6',
width: 1920,
height: 1280,
format: 'jpg',
resource_type: 'image',
created_at: '2020-11-26T16:38:37Z',
tags: [],
bytes: 152009,
type: 'upload',
etag: 'f0533f1e2b10787078f88cc5e1611610',
placeholder: false,
url: 'http://res.cloudinary.com/bikievents/image/upload/v1606473662/hti9ug6hafzn7q62fi0l.jpg',
secure_url: 'https://res.cloudinary.com/bikievents/image/upload/v1606473662/hti9ug6hafzn7q62fi0l.jpg',
overwritten: true,
original_filename: 'file'
}0 -
Hi Lekan,
The version number represents the upload time of the asset as a UNIX timestamp. It's always returned in API responses and is part of the 'url' and 'secure_url' fields. It's not possible to omit it from the response, but if you want to access URLs without the version number then you can and they will work as normal. In addition, you can use any of the SDK's helper methods that allow you to build URLs to generate URLs without a version. For example, you can just pass a public_id without a version number to the helper methods and then also include the 'force_version' parameter set to False and that will generate a URL without a version.
0
Post is closed for comments.
Comments
3 comments