Welcome to the LimeSurvey Community Forum

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

Problems downloading files from survey

  • aquigar
  • aquigar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200370 by aquigar
Hi all:

(Limesurvey 3.22.17+200525 here! )

I´m experimenting problems trying to download uploaded files from responses in my surveys.

First, I can't find anywhere the icon to download all the uploaded files at a time...
I found this:
bugs.limesurvey.org/view.php?id=15320
but I'm not sure if it means that the icon is missing from recent versions of Limesurvey.

I've tried first this way:
Code:
https://your-limesurvey-domain.com/index.php?r=admin/responses/sa/actionDownloadfiles&surveyid=577546&sResponseId=6

where:
surveyid=577546 (my survey id)
ResponseId=6 (a response with uploaded content)

This works great. One response at a time

Next test (multiple responses):
Code:
https://your-limesurvey-domain.com/index.php?r=admin/responses/sa/actionDownloadfiles&surveyid=577546&sResponseId=6,12
It doesn't work :(
It seems to produce an error 500 but I haven't been able to debug so far.

Last test(all responses):
Code:
https://your-limesurvey-domain.com/index.php?r=admin/responses/sa/actionDownloadfiles&surveyid=577546&sResponseId=
(With empty argument for sResponseId)
It doesn't work, but looking at the github code:
github.com/LimeSurvey/LimeSurvey/blob/ma...n/responses.php#L803
seems to be valid for a full zip download


I would greatly appreciate if someone could test this in his/her own installation so I could tell if it is a local problem or a bug.

Thanks in advance and take care :)
Regards
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200377 by holch
Replied by holch on topic Problems downloading files from survey
I don't see the problem. Limesurvey seems to do what it is supposed to do, it downloads the files. However, one by one.

Does the manual state somewhere that you can download various files at the same time?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • aquigar
  • aquigar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200383 by aquigar
Replied by aquigar on topic Problems downloading files from survey
Hi:
When you are positioned in responses list view ("Show responses" button) you can select a group of responses with uploaded files and take an action for the whole group.

One of these available actions is "Download Files". Please, see pic. attached
The button press generates a call like the indicated above:
https://your-limesurvey/limesurvey/index.php?r=admin/responses/sa/actionDownloadfiles&surveyid=577546&sResponseId=6,12,19,21

This does not work for me, thats what I´m looking for help. I need to download hundreds of attached files so is hard to do one by one.

The single button for downloading all at a time is of interest because the method above is restricted by pagination, you can only select responses from a single page of view (100 elements max at a time).

The same problem is referenced here:
forums.limesurvey.org/forum/can-i-do-thi...uploaded-by-my-users

Anyway, I know this button has existed before because I've used it myself in the past.

I know I can get the files directly from the server, but they are named with hashes, and it's hard to "correlate" by hand.

Anyone knows a workaround?

Regards
Attachments:
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200386 by holch
Replied by holch on topic Problems downloading files from survey
OK, understood the problem now. Would need to test to see if this is a problem here as well or if it is only on your installation.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago #200404 by DenisChenu
Replied by DenisChenu on topic Problems downloading files from survey
Since you read PHP, i think you can do plugin
gitlab.com/SondagesPro/ExportAndStats/downloadMyFiles

for sample :)

Else : yes you can update sResponseId to 1,2,3,4 i just check on 3LTS : seems to work.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • aquigar
  • aquigar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 10 months ago #200426 by aquigar
Replied by aquigar on topic Problems downloading files from survey
Ok I finally could resolve the issue.
Once resolved, it result very obvious as usual :)

The problem is the size of the .zip generated with the query.

When the size of the response exceeds memory_limit parameter inside php.ini file, the response gets truncated silently.

I increased this limit for the time to download and restore afterwards, so...problem solved.

Thanks Denis and holch for answers an read :)

That's the code involved if any is interested:
Code:
https://github.com/LimeSurvey/LimeSurvey/blob/master/application/controllers/admin/responses.php#L1028
The following user(s) said Thank You: DenisChenu
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose