Reputation: 11
Please tell where to specify the upload_preset and also help with the image uploading part.
let options : FileUploadOptions = {
params:{'upload_preset':'preset1'},
}
const fileTransfer: FileTransferObject = this.transfer.create();
fileTransfer.upload('assets/demo.jpg',
'https://api.cloudinary.com/v1_1/dvkvdp0bp/image/upload', options,true)
.then((data) => {
alert('DONE!');
}, (err) => {
// error
})
Upvotes: 0
Views: 260
Reputation: 3693
In your example, upload preset is wrapped in '', please remove that. The following worked for me.
let options = {
params: {
upload_preset : 'example',
api_key:'187673838930038',
file:filename,
}
}
Upvotes: 0
Reputation: 301
Here is a video to show how to add an upload preset: http://res.cloudinary.com/demo/video/upload/v1521058712/upload-preset_j96a2f.mp4
If you want, you're more than welcomed to open a ticket and we'll be happy to suggest specific tips for you regarding uploading an image.
Upvotes: 0