Search code examples
phpnode.jsreact-nativelimesurvey

How to upload file in limesurvey


Hi I am using limesurvey API to build survey mobile app. My problem is I can able to use all APIs, but when I am trying upload a file I am unable upload every time it return null response. {"id":1,"result":null,"error":null}

This is the URL for the documentation for all APIs https://api.limesurvey.org/classes/remotecontrol_handle.html#method_upload_file I used same.

Here is my API example params.

{ "method": "upload_file", "params": [ "tx3yitmq3aqj39g2mbdgprke2hi9brgs", 323169, "323169X48X478", "google.png", "iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAAJFBMVEX/////QAAAAAD8/Pzz8/PZ2tr/QwC1JgDxPABJVVdGU1Ssrq/GbyqyAAAAoElEQVR4nO3WiQ0DIQwEwMN89/TfbxLp0kEIEjdTwa4sjLcNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIBfySXPjjBUPSLiqLNjjHNFTy31uGYHGaXG3lJKbY9Vp3j2T8F3xX7OjjJGjvQVa66bEu0u2KLMDjPE+jNc/x0+YJeu/x8+4KbZ1r9LAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+6wV0kgG++h5fhgAAAABJRU5ErkJggg==" ], "id": 1 }

Actual API expecting. upload_file(string $sSessionKey, integer $iSurveyID, string $sFieldName, string $sFileName, string $sFileContent) : array

I am passing all params but I am getting null result and file not uploading

Anybody help on the same? Thanks.


Solution

  • gone through the many documentation finally, Its not possible with limesurvey below v3.15