1 (edited by FMR 2022-05-12 08:31:06)

Topic: How to rename Files Saved in LinkFile ?

Hello,

In attachment example about contacts form with photo stored as LinkFile
How to save the image files as Counter value or Contact Name ? instead keeping original file name

Post's attachments

Attachment icon LinkFile File Name.zip 46.07 kb, 130 downloads since 2022-05-11 

Life is like a school;
One can learn and graduate or stay behind.

Re: How to rename Files Saved in LinkFile ?

Hi FMR,
This is one of those problems that sounds simple but is actually a bit fiddly, particularly when you want to do everything off just a single form.
When adding a record (as far as I know), you can't change the image filename at the point of saving so you have to change it using save 'onafterclick'.
When editing an existing record, when you want to replace an image, you need to delete the original image and then save and rename the new image.
When you want to delete, it's not just a standard 'record delete' from a table but you also need to find the associated image (wherever it's stored) and remove it first.
Anyway, have a look at the attached which should give you an idea of how to tackle it (it uses the contact 'name' rather than the record-id (which doesn't really help to identify the images in the linked folder).
Derek.

Post's attachments

Attachment icon LinkFile File Name.zip 346.25 kb, 155 downloads since 2022-05-12 

Re: How to rename Files Saved in LinkFile ?

Hi derek

You do a hard job for me, I'm really appreciated your work

Life is like a school;
One can learn and graduate or stay behind.