File upload always fails
File upload always fails
Hi
I am trying to upload an image from editor form as below
{
label: "Image:",
name: "image",
type: "upload",
display: function ( id ) {
console.log(id);
return '<img src="'+ base_url +'/web/uploads/temp/'+ id +'"/>';
},
noImageText: 'No image'
}
I have confirmed that the file is getting uploaded successfully with response from server as below..
{"data":{"upload":{"id":"4872f7a766e4cb216b194bc7d185c758.png"}}}
but somehow, the console.log in display function is not happening.. that means the display function is not getting executed...
Can u please help me with this ??
Also, I want the user to be able to upload the image both while creating and updating a record ..
so is there a way to pass the record ID when uploading an image .. maybe 0 for new and ID for editng the image ??
Regards
Kaustubh
This question has an accepted answers - jump to answer
Answers
Hi Kaustubh,
Can you give me a link to the page showing the issue so I can help to debug the issue please?
Allan
Sorry allan.. its difficult for me to give u a link.. but here is my src code.. with API response...
API Response
I have confirmed that the image is getting uploaded successfully..
but after the response nothing happens... I mean I added alert in display function but it does not get executed..
Thanks for the help...
Hi Allan,
Please use the below details
Hope this will work for you...
Hi allan,
Please use the below details
Thank you. Could you give me instructions on how to recreate the issue in your page? I don't see an upload field:
Allan
oh.. I Am sorry ... the second URL was wrong.. but I figured it out myself... was a problem with ID that is return after the image is updated...
Thanks for checking though...!!!