Is there an API like "get_url_from_uploaded_file" ?

More
1 year 1 month ago #192896 by phessbrueggen
We want to use Limesurvey as a CMS source.


We are looking for a way to get the url of an uploaded file (jpg, png etc)

Does anyone know an api call or another solution?


P.S.

Since a few days the API doku is no longer available..

api.limesurvey.org/classes/remotecontrol_handle.html

Support ticket is open but not answered yet :-(

Please Log in to join the conversation.

LimeSurvey Partners
More
1 year 1 month ago #192906 by tpartner
get_uploaded_files() - api.limesurvey.org/classes/remotecontrol...d_get_uploaded_files

The API documentation page seems to be fixed now.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
The following user(s) said Thank You: DenisChenu, phessbrueggen

Please Log in to join the conversation.

More
1 year 1 month ago #192921 by DenisChenu
Strange get_uploaded_files accept token, but to response id …

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 following user(s) said Thank You: phessbrueggen

Please Log in to join the conversation.

More
6 months 4 days ago #204500 by Mazi

DenisChenu wrote: Strange get_uploaded_files accept token, but to response id …


That is really weird. Why is the token used instead of the data set ID? That doesn't make sense at all:
1. Mostly there are no tokens.
2. With certain settings you can have the same token for multiple data sets.
3. The ID is the unique key at the response table, not the token.

@Denis: What do you think how can this best be improved? Copy the function, rename it to get_uploaded_file_by_id() and make some minor adjustments to use the data set ID instead of the token?
What do you think?

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Please Log in to join the conversation.

More
6 months 4 days ago - 6 months 4 days ago #204502 by DenisChenu
I don't need such functiuonnality currently


My opinion :
1: get_uploaded_files is a bad name … must be get_uploaded_files_by_token
2: but rename it broke API (and can broke a lot of system)
3: then do : get_uploaded_files(string $sSessionKey,integer $iSurveyID,string $sToken,int $srid)

Else : i get the file by : gitlab.com/SondagesPro/ExportAndStats/downloadMyFiles

PS : i fix phpdoc ! github.com/LimeSurvey/LimeSurvey/commit/...9f8b38f7a4393ed7bfcb

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.
Last edit: 6 months 4 days ago by DenisChenu.

Please Log in to join the conversation.

More
6 months 4 days ago #204507 by Mazi
Thanks for your feedback, Denis!

I agree that we should NOT change the function name.

So you suggest adding a third parameter $srid and if that one exists, query the data by data set ID instead of by token?
Sounds like a reasonable approach.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Please Log in to join the conversation.

More
6 months 4 days ago #204508 by DenisChenu

Mazi wrote: So you suggest adding a third parameter $srid and if that one exists, query the data by data set ID instead of by token?

Yes, and throw error if both is null.

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.

Please Log in to join the conversation.

More
6 months 4 days ago #204517 by Mazi
Bug report created at bugs.limesurvey.org/view.php?id=16619.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com
Want to use your survey offline -> www.offlinesurveys.com

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now