I’ve looked around at the video tutorials, docs and forum but I see no mention of how to upload photos with the medium editor. I’m assuming this is out there somewhere but this might be a nice addition to the forum!
I’ve tried figuring it out myself. I have a database table with the text from the medium editor and the blob. In Wappler I have the database insert working for the text, and I made a separate server action for the image. This didn’t work so I tried adding a step to the existing insert server action for uploading the image which also didn’t work.
I think the problem is in the element name for the medium editor. Because I am using that post variable for the text how do I use it for the image?
You can set a dynamic path or mix of dynamic and static using the using bracketed notation, for example if you wanted each user to have their own sub under /images based in their id you could use something like
/images/{{security1.identity}} or /images/{{$_POST.userid}}
(dont forget to check create path in such as case)
Alright so I’ve almost got it working. Now I can successfully upload photos, however they will not display. I just see the broken image icon. So I’m guessing my problem is the Load Image step. My path is set to {{upload1.path}}. File upload’s name is set to upload1. Is this correct?
I also tried manually entering the path like this: /assets/Mediumeditorimages/{{upload1.name}}
This didn’t work.
Will the medium editor automatically display images if you have a query set up for it? I am expecting the images to show up along with the text in the query I have set up already. Is that an incorrect assumption and I need a new query for images?
Your images are uploaded correctly, all loading into the \assets\MediumEditorimages folder
I suggest you remove spaces from the file names (checkbox option) as spaces sometimes cause issues
HOWEVER, big apologies, i failed to explain the last step needed (you may have noticed it in the screen grabs but i forgot to explain it (i was in a rush to go out)
You need to return the URL of the image to medium editor after processing at the end of the server action
So add this to the end of the upload action and all should be working
@Teodor, thanks for getting back to me so quickly. Actually the image upload addon is enabled. see image below:
Note the issue takes place only after I add the sever action to the image upload addon.
The other 2 do not have the image upload addon is enabled. (see image below)
However, you are right that Medium Editor for the other 2 have the add image enable, I am trying to remove it from the interface as I don’t want users to upload to those editors.
@Teodor, please do not be sorry, it may be me not being able to properly explain.
The first Medium Editor is the one that should upload the images. that one has the image upload addon enabled.
The last 2 Medium Editor do not have the the image upload addon.
Please note: that for the first Medium Editor (the one with the error) if I were to remove the server action, then when I add an image it shows in the Medium Editor, but as soon as the server action is added, the image no longer shows. That is why I have added the steps I used, as I think the I am doing something wrong in there.
Hi @patrick thanks a lot for helping me on this. I had replaced the file, however I am still getting the same issue. However, I wan to make sure it is not me adding the file to the wrong place. I replaced the file under this folder path (dmxAppConnect\dmxMediumEditor). could you please confirm if I did it correctly.
Thanks again for all your help.
Best regards
Juan