Upload Widgget - fieldName not working
Am using the upload widget in Rails, uploads fine but doesn't update fieldName ,
Have tried many variations to see if I can fix it but nothing seems to work.
Am I missing calling some method to get htis or something
js looks like this
<script type="text/javascript">
//Step 2.1: Declare your uploadwidget variable
var myUploadWidget;
document.getElementById("upload_widget_opener").addEventListener("click", function() {
myUploadWidget = cloudinary.openUploadWidget({
cloudName: "NAME",
uploadPreset: "NAME",
fieldName: 'book[cover_url]',
//Step 3: Add list of sources that should be added as tabs in the widget.
sources: [
"local",
"url",
"camera"
],
},
function(error, result) {
//Step 2.3: Listen to 'success' event
if (result.event === "success") {
//Step 2.4: Call the .close() method in order to close the widget
// myUploadWidget.close();
}
});
}, false);
//Step 2.2: Call the .open() method in order to open the widget
myUploadWidget.open();
</script>
-
Also now find that version1 of upload widget does work!
0 -
Now getting there
I can get v2 to work but for anyone else having this problem
Don't put the script inside the form tag!
0 -
Hi
Glad to see it works for you now,
Please let us know if you experience any issue.
Best,
Yakir
0
Post is closed for comments.
Comments
3 comments