Page 1 of 1

Attached file - AppGini 24.15

Posted: 2024-07-06 21:34
by Moh Youba
Hello

Please, need your help.
Where are stored attachement, how to select all atachement of specific user and download one time?
appgini.jpeg
appgini.jpeg (16.13 KiB) Viewed 4647 times
Thank you

Re: Attached file - AppGini 24.15

Posted: 2024-07-07 11:14
by a.gneady
By default, attachments are stored in the subdirectory images inside your app folder.
how to select all atachement of specific user and download one time?
This could be done via JavaScript code in hooks/tablename-dv.js ... the basic idea is to find all attachment links from current record and then trigger a click event on each. You might perhaps want to distance each click with an interval of one second or so.

Re: Attached file - AppGini 24.15

Posted: 2024-07-07 12:53
by Moh Youba
Hello Ahmed
Thank you for kind support.
Going to have a try

Re: Attached file - AppGini 24.15

Posted: 2024-07-07 13:02
by Moh Youba
I ask help from ChatGTP and this is the answer, what do you thing about?

// Ensure the script runs only after the DOM is fully loaded
jQuery(function($) {
// Function to trigger clicks on attachment links
function triggerAttachmentClicks() {
// Select all attachment links within the current record view
var attachmentLinks = $('a.attachment-link-class'); // Replace 'attachment-link-class' with the actual class or selector

// Define the interval (in milliseconds) between each click
var interval = 1000; // 1 second

// Loop through each attachment link and trigger a click with a delay
attachmentLinks.each(function(index, element) {
setTimeout(function() {
$(element).trigger('click');
}, index * interval);
});
}

// Call the function to start triggering clicks
triggerAttachmentClicks();
});