Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Download all uploaded files from a file upload question

More
3 weeks 16 hours ago #273445 by holch
Please help us help you and fill where relevant:
Your LimeSurvey version: LS 6
Own server or LimeSurvey hosting: Own hosting
Survey theme/template: not relevant (the same for all)
==================
I am currently using Limesurvey together with Denis' sign pad plugin and the PDFreport plugin as a simple digital signature platform. This works pretty well, but now I want to download the created PDF files (signed documents) and I did not find the possibility to download all files at once. They are stored in a folder, but with a completely different name and without .pdf at the end, so I would have to rename them and this would be a hassle.

I can go to the response page, let 100 show and then mark all and download them. However, I have collected about 1200 signatures, so I would have to do this about 12 times. Doable, but annoying. So I was wondering if there is a better solution, that I just have not found yet.

And the survey response page is a usability nightmare. You can get hardly any responses on the screen because there is so much white space. I understand, whitespace is important, but in this case I would sacrifice the white space for being able to see more responses on the same screen. Also, you constanctly have to scroll in all directions and the horizontal scrollbar is only available at the bottom of the list, so is the dropdown menu with the actions. but the filters are only available at the top, so you are constantly scrolling with the browser scrollbars as well as the Limesurvey scrollbars. It is just not a good solution, I think. But that is probably it's own thread. ;-)
 

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
2 weeks 1 day ago - 2 weeks 1 day ago #273446 by Joffm
Hi, @holch,
unfortunatley I do not see a solution for your issue.
(Das Kind ist ja schon in den Brunnen gefallen).

But i have two solution to improve the workflow during the field work.

1. In the end-message I do an ajax call
This copies the "fu_"-files to the original name in the files folder of LimeSurvey
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
$.post( 'https://www.myServer.de/myFiles/copyFile.php', { rid: "{SAVEDID}", sid: "{SID}", gid: "{Report.gid}",   qid: "{Report.qid}" })
  .done(function( data ) {
  });
});
</script>

and a php script like
Code:
<?php
require_once 'meekrodb.class.php';
// I use this library to connect to MySQL
 
  DB::$error_handler=true;
  DB::$nonsql_error_handler=true;
 
  DB::$host='myHost';
  DB::$user='myUser';
  DB::$password='myPassword';
  DB::$dbName='MyDB';
  DB::$encoding='utf8';
 
$rid       =$_POST['rid'];
$sid       =$_POST['sid'];
$gid       =$_POST['gid'];
$qid       =$_POST['qid'];
$tbl_daten ='lime_survey_'.$sid;
$col_files =$sid.'X'.$gid.'X'.$qid;
 
$daten=DB::queryFirstRow("SELECT {$col_files} FROM {$tbl_daten} WHERE id={$rid}");
foreach ($daten[$x] as $key => $value) {
     $start=strpos($value,'fu_');
     $ende=strpos($value,'"name')-2;
     $len=$ende-$start;
     $tmpfname=substr($value,$start,$len);
     $start=strpos($value,'"name')+8;
     $ende=strpos($value,'ext')-3;
     $len=$ende-$start;
     $orgfname=substr($value,$start,$len);
 
     if (!file_exists('../lime6/upload/surveys/'.$sid.'/files/'.$orgfname)) {
       copy('../lime6/upload/surveys/'.$sid.'/files/'.$tmpfname,'../lime6/upload/surveys/'.$sid.'/files/'.$orgfname);
     }
}
?>


Rough - working - idea, can be / should be improved.

2.
a. Send the created pdfs to your email account,
 
b. create a filter to move them to a specific folder - here in Thunderbird 
 
c. with an add-on like Extract 'Em! extract all attachments and store them into one zip-file
 

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 2 weeks 1 day ago by Joffm.

Please Log in to join the conversation.

More
2 weeks 1 day ago #273447 by Joffm
Sorry, a small mistake.

Instead this (relict from a previous version)
foreach ($daten[$x] as $key => $value) {

this  
foreach ($daten as $key => $value) {

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 week 6 days ago #273449 by holch
Thank you for the script and the ideas, Joffm!

I am wondering if we shouldn't have a feature that just allows you to download all the files at once.

I mean, it is not a huge deal to do 12-13 downloads once in a while and not all studies are of that size. But I think this is probably a tiny thing to do in programming and should be a feature, i think.

Happy holidays, by the way!

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose