file upload question: where are the files stored?

More
3 years 10 months ago #99955 by ricardo01
ricardo01 created the topic: file upload question: where are the files stored?
I'm having problems downloading files uploaded using the Upload file question type. Where are these files stored? How can I download them?

Please Log in to join the conversation.

More
3 years 10 months ago #99969 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?
You can download them in "browse response" page.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 10 months ago #99982 by ricardo01
ricardo01 replied the topic: file upload question: where are the files stored?
Thanks Dennis,

I cannot download them from the browse response page because ALL files uploaded by 150+ people are corrupted.

So I'd like to check if the files are corrupted after downloading them or when uploading them.

To find 1 or 2 corrupted files wouldn't be anything out of the ordinary...but every single file is not a coincidence.

so, I'd like to know if there's a way to get to those files that is not through the browse/display response page

Please Log in to join the conversation.

More
3 years 10 months ago #100001 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?
Hi,

In the database you have the new filename : something like this jgftftsqd5454hhgh .
And the file are in
./upload/survey/{SID}/files

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
3 years 10 months ago #100276 by DWS
DWS replied the topic: file upload question: where are the files stored?
but this is not very helpfull, because not only the filename is changed, also the extension, so I can't get directly from the directory, I have to get it from the responses view.

Also if I try to download it from the resources menu, I get the zip with this wrong file name and wrong file extension.

So, there's anyway to get the file directly from the directory?

thanks
regards

Please Log in to join the conversation.

More
6 months 2 weeks ago #148084 by alexgarciac
alexgarciac replied the topic: file upload question: where are the files stored?
hi, I am accessing the folder where uploaded images are stored in limesurvey. the problem is that all images and pdfs are stored as fu_zytptcq2zpbwtsd with no indication whatsoever about the type of file (pdf, jpg, etc). so once I download it into my pc, I can only find out the content of the file in my mac because preview is smart enough as to convert what ever it is and display it. but in windows I just cant find out how to determine the type of file I am dealing with, no extension, no indication as for the file type. how can I transform whatever limesurvey is doing to the uploaded files into something usable?

Please Log in to join the conversation.

More
6 months 2 weeks ago #148091 by tpartner
tpartner replied the topic: file upload question: where are the files stored?
The filenames are intentionally obfuscated. The simplest workaround would be to send yourself a basic or detailed notification email and click on the "view response" link. From there you can download the file.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 months 2 weeks ago #148093 by jelo
jelo replied the topic: file upload question: where are the files stored?

alexgarciac wrote: I can only find out the content of the file in my mac because preview is smart enough as to convert what ever it is and display it. but in windows I just cant find out how to determine the type of file

To find out the type of files you might try some of these tools:
www.raymond.cc/blog/what-file-is-that-ho...es-types-and-format/

A obfuscation with filetypesuffix in cleartext wouldn't raise the risk of file exposure to third parties that much.
At least not for direct access via URL/path

Please Log in to join the conversation.

More
6 months 2 weeks ago #148111 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?
PS : this file upload question type must be really rewrited for
- Save file elsewhere on the disk (with a cleaner file name, but out of web access)
or
- Save file in DB

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
6 months 2 weeks ago #148123 by holch
holch replied the topic: file upload question: where are the files stored?
I also find it strange that it seems so complicated to get to these uploaded files. I mean, security of the files is important, but if it is so complicated (never used this question type, I only see the confusion on the forum), then this question type is basically useless for most users, because they don't know how to get to their files.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

More
6 months 2 weeks ago #148155 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?
@holch : currently : we are unsure user have access to a directory out of web. This system is used with very important thing sometimes ( CV/ Contract / id card etc ...) then we must NOT show it publicly.

Like i put in the report : i think there are only 2 ways to have a clean upload file system
- Save in DB only : it's more difficult to find it ...
- Save on the server out of web server : need configuration

If anyone are interested by a plugin : 'moveFileUploadToDir' when survey is submitted : i can make an offer.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
6 months 1 week ago #148162 by jelo
jelo replied the topic: file upload question: where are the files stored?
The obfuscation is OK.

The issues around fileuploads storage are always:

1.) Preventing access via guessing a direct link to the file. E.g. when the pattern of the files is widely known.
2.) Prevent access when PHP is not working (correctly). E.g. php code will be displayed in the browser.
3.) Prevent access when Webserver is not working (correctly). E.g. htaccess no longer working.
4.) Make is easy to download file for survey admin.

For me the biggest issue with the current file upload question is the lacking of removing the files when deleting the survey and the database. The whole application gives the user the impression that the uploaded files are gone too.
The uploaded files stay on the server.

An option to config the upload path would be a good idea. That will allow people to move the storage location outside the webroot. Most people won't change it. But security gets improved. Same should be done with the databasebackup during the comfortupdate. These are also at risk of getting downloaded.

BTW: I always wonder why people use LimeSurvey for creating online-forms. Even the simplest address form looks strange with LS (E.g. too much space between the text inputs. No free positioning of fields.)
In public surveys the upload question is not that commonly used.

Please Log in to join the conversation.

More
6 months 1 week ago #148170 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?

jelo wrote: ....
For me the biggest issue with the current file upload question is the lacking of removing the files when deleting the survey and the database. The whole application gives the user the impression that the uploaded files are gone too.
The uploaded files stay on the server.
....

BUT !

I think upload/survey/XXXX/ directory are deleted when delete a survey, it's not true ? Really a bug here ....

There are code for deleting files when you delete one response : github.com/LimeSurvey/LimeSurvey/blob/ma...els/Response.php#L14

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
6 months 1 week ago #148178 by jelo
jelo replied the topic: file upload question: where are the files stored?

DenisChenu wrote: I think upload/survey/XXXX/ directory are deleted when delete a survey, it's not true ? Really a bug here ....

There are code for deleting files when you delete one response : github.com/LimeSurvey/LimeSurvey/blob/ma...els/Response.php#L14


I only use LTS. You describe two situations:

1.) Deleting survey
2.) Deleting one response.

The most common scenario is just deactivating the survey and than from time to time doing a "check data integrity".
In that scenario the uploaded files stayed on the server. You can say that is an intended behavior but I doubt many users differentiate between database and file-based responses.

Will check again, but in the last years I always deleted uploads by hand from the server after the survey was deactivated and responses where purged via "check data integrity".

LS should clearly separate deleting of survey (structure and assets) vs. deleting of responses (db and uploads).

Please Log in to join the conversation.

More
6 months 1 week ago #148184 by DenisChenu
DenisChenu replied the topic: file upload question: where are the files stored?
OK, your right : deactivate survey don't delete already answers. But there are another problem if we delete file upload : if user reactivate survey and reload answer DB : the file was lost. In fact : deactivate survey don't really delete responses : make a backup ...

Files are deleted when 1 and 2 , not when deactivated.

New checkbox when deactivate ????

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

Did you already participate in our customer survey?

Don't miss your chance for great prices.

Please click here to participate:

Start now

Start now!

Just create your account and start using Limesurvey today.

Register now