Open mouzofabricio opened 7 years ago
Good question @mouzofabricio. How do you want the uploads to work, exactly?
Medium Editor Insert Plugin uses BlueImp's jQuery File Upload to handle uploads. Unless there's a way you can work its options to do exactly what you want, then I'd be tempted to write a custom addon for Medium Editor Insert Plugin for your specific upload process.
Hi Will,
Thanks for your quick response.
Right now I managed to add a url parameter to fileUploadOptions and it actually hits the endpoint correctly but I get an error on the reponse as if it was undefined. From the chrome devtools i see the correct response from the server.
This is the response I send from the "firebase functions":
const data = {
files:
[
{
url : 'https://firebasestorage.googleapis.com/v0/b/babel-77d1f.appspot.com/o/bg_contacto.jpg?alt=media&token=6c661655-d18c-45a1-a30a-ae94d2b37c52'
}
]
};
res.setHeader('Content-Type', 'application/json');
res.send(JSON.stringify(data), null, '\t');
And this is the error I'm get in Ember: Uncaught TypeError: Cannot read property 'files' of undefined
Hmm, that payload seems like it should work. Is it responding with a 200 status?
The main problem with Ember Medium Editor Insert Plugin is that there's no method of inspecting or adapting the response before it's handled and inserted into the DOM.
Though there's an open PR #384 to enable you to use the default uploader add
and done
functions.
@mouzofabricio, did you find a good solution? If so, can I close this issue?
I've been using this plugin and it works perfectly out of the box. Nevertheless, I'm working in a project with ember-fire (firebase db) and whenever I upload an image it gets embedded as base64 code which makes the upload and download times take forever.
Is there any way to implement a custom upload code so I can set another server to upload the images and generate the urls ?
Thanks!