Welcome to the LimeSurvey Community Forum

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

Is there an API like "get_url_from_uploaded_file" ?

  • phessbrueggen
  • phessbrueggen's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 6 months 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 :-(
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 6 months 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.
The following user(s) said Thank You: DenisChenu, phessbrueggen
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months 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
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 10 months 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: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months ago - 3 years 10 months 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: 3 years 10 months ago by DenisChenu.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 10 months 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: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 10 months 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.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
3 years 10 months ago #204517 by Mazi

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose