Show picture on click event

Hi @mark-piller

So I had a look at JSON and now understand the basic format, I’m not yet sure how I can get codeless logic to save multiple URLs into a JSON column, but I will keep looking into this.

In the meantime I thought of another way around this would be saving each url of the file saved in a separate table in the database called “Attachments”, then I can create a relation between the “Invoice” table with the column called “attachments” to the table “Attachments”. With a 1:n relation this will allow me to link many urls to one invoice. My thinking was…

  1. If I save a picture to my files a URL is returned, I can then save that URL in the “Attachments” table under the “url” column.
  2. Once the Invoice is saved I can add a relation between the saved Invoice recored in the “Invoice” table and the saved URLs in the “Attachments” table.
  3. Once I have a relation, when the invoice needs to be changed/updated the related attachments in the “Attachments” table can be easily fetched from the database.
  4. New pictures/relations/files can be created or deleted easily.

I have done this and it seems to work, with your expert opinion do you think this is a sustainable/scalable substitute to the JSON option?

==================================

Another thing I noticed is that my photos is being saved to my files but not to my target directory. So my target directory is “images/jobcards” as you can see in the below screenshots…

Screenshot 2022-07-05 at 23.23.38

Screenshot 2022-07-05 at 23.22.40

But when I have a look in my files nothing appears, as seen in screenshot below…

When I have a look at the URL of the saved picture/file it does not reference to the “images” or “jobcards” folder but only references the “files” folder.

https://backendlessappcontent.com/56447795-182A-D679-FF9E-05029343F800/528E8790-099C-4C3E-A8A1-7BE11FC36BC5/files/carengine.jpeg

If you click on the link it will open the picture but yet it is not shown in my files at all, see screenshot below of “files” folder (carengine.jpeg is not shown).

Kind Regards
Donovan

Hello @Donovan_Hardwick

Target Directory Logic - it’s a handler that try to find images/jobcards property in view-attachment model.
I believe if you remove this handler, and leave only Directory at settings that will work fine.

Thank you @Dima

It worked!!!

Kind Regards
Donovan