Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81909

File upload always fails

$
0
0

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


Viewing all articles
Browse latest Browse all 81909

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>