Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
Can I download all the attachment files in dynaform only with one button/click?
Because sometimes my dynaform contains many uploaded documents and it's gonna be good for the user if they can download all of it at the same time instead of download the file one by one. Thankyou for your help.
There is no easy way to implement this.

You can download a single file in a MultipleFile field with this JavaScript:

Where MultipleFileID is the ID of the Multiple File field and X is the index number, such as 0, 1, 2, 3, etc.

However when I tried this code, I found that FireFox 60 and Chrome will only allow you to download one file and ignores the other download attempts. I tried this code:
Code: Select all
$("#downloadAll").find("button").click( function() {
  var aFiles = $("#specFiles").find("a.fa-download");
  var i = aFiles.length - 1;
  for (; i >= 0; i--) {
} );
I also tried using a settimeout() to download at different times, but I couldn't get it to work.

The only solution is to fire a trigger beforehand that queries the APP_DOCUMENT table in the database, and then uses exec("tar -cf files_case_X.tar file1 file2 file3") to create a tar file which contains all the files from the case. Then, use PMFAddInputDocument() or G::uploadFile() to add that tar file to the case. Then, display a link in the Dynaform to download that tar file.

Yeah That will be very helpful :) Thank you

variable in external libs

Ohhh I tried this thing before but didn't work tha[…]

Limit List box

Hello Amos, The following solution is working. $[…]

It looks like jquery.masknumber.js has problems in[…]