How to add additional information to an uploaded image?
First I'd like to say hello Cloudinary community! Greetings!
I have an upload function, like so:
```
export const openUploadWidget = (options, callback) => {
constscOptions=Util.withSnakeCaseKeys(options);
window.cloudinary.openUploadWidget(scOptions, callback);
};
```
And passing it some options:
```
And passing it some options:
```
const beginUpload=tag=> {
constuploadOptions= {
cloudName: 'hillfinders',
tags: [JSON.stringify({ userId: tag })],
uploadPreset: 'upload',
userId: userId
};
openUploadWidget(uploadOptions, (error, photos)=>{
if(!error){
console.log('photos ImageUploader line 28', photos);
if(photos.event==='success'){
avatarUpdater(photos.info.secure_url);
}
} else {
console.log(error);
}
});
};
Essentially I want to add a id field on the image so I can sync it with a logged in user from my server.

0
-
Hi Antonio,
You can add `context` as one of the upload widget options, where you can store additional information such as the `userId`. For more information, you can check out our documentation here.
0
Post is closed for comments.
Comments
1 comment