Sign In Register

How can we help you today?

Start a new topic
Answered

How to access uploaded file by form?

Hi, i have the following screen code:


    <gs-form snippet="upload_questions" target="upload_questions_result">

        <gs-row>

            <gs-col width="6">

                <input type="file" name="questionsFile" value="d"/>

            </gs-col>

            <gs-col width="3">

                <gs-submit>Submit</gs-submit>

            </gs-col>

        </gs-row>

    </gs-form>


How can i access uploaded file content in my snippet? I have already tried Spark.getData().scriptData, but it is not working.


Best Answer

 Sorry Rafal, this functionality is currently not possible from GameSparks dynamics forms.

Sean


Hi Rafal,


Can you let me know what you're trying to achieve here ? Going by the name "questionsFile" I'm assuming this is a file containing some new questions you want to add to your game ? If so you might be better off storing these new questions in a custom runtime collection. If you let me know a bit more about your game I can help you find a solution that works best for you.


Thanks,

Liam

Hi Liam,


I am developing quiz like game and i have to upload my questions to database. I think that best way for storing these questions is store one question in one document. I have a lot of questions in a xsl file and i guess i should convert this file to json, then upload as database collection. I don't see where i can upload json as collection, so i am going to write form for this. I think that meta collection is better for me than runtime collection because only i can upload new questions (my players can't).


Regards,

Rafał

Answer

 Sorry Rafal, this functionality is currently not possible from GameSparks dynamics forms.

Sean

Login to post a comment