Attached file - AppGini 24.15

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
Moh Youba
Veteran Member
Posts: 235
Joined: 2017-03-12 09:31

Attached file - AppGini 24.15

Post by Moh Youba » 2024-07-06 21:34

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 545 times
Thank you

User avatar
a.gneady
Site Admin
Posts: 1309
Joined: 2012-09-27 14:46
Contact:

Re: Attached file - AppGini 24.15

Post by a.gneady » 2024-07-07 11:14

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.
:idea: AppGini plugins to add more power to your apps:

Moh Youba
Veteran Member
Posts: 235
Joined: 2017-03-12 09:31

Re: Attached file - AppGini 24.15

Post by Moh Youba » 2024-07-07 12:53

Hello Ahmed
Thank you for kind support.
Going to have a try

Moh Youba
Veteran Member
Posts: 235
Joined: 2017-03-12 09:31

Re: Attached file - AppGini 24.15

Post by Moh Youba » 2024-07-07 13:02

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();
});

Post Reply