AJAX Post to URL doesn't send the whole string (Stringified JSON)

0 favourites
  • 3 posts
From the Asset Store
We present to you “Post Apocalyptic Trailer” – our newest hard hitting, bass rumbling designed movie trailer collection.
  • I have made a simple JSON editor app with Construct 3.

    I have Input Text window to edit text (in this case json structure).

    Then I parse this text content into JSON Object and it works well.

    Then there are buttons to execute saving and loading functions.

    Saving function:

    Contents of the write.php: // project is located on my personal domain

    My JSON has now 13000 characters, but only some 5000 gets through to php.

    I have tried both beautified and compact string formats and both work, but only less than half characters get saved.

    I pasted some random text from wikipedia to text field and it can save and load

    100000 characters easily, so it kind of works...It's just this JSON formatting seems to cause problems.

    Perplexed. Not experienced coder. Help much appreciated!


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • did you try to URLEncode the text before you send it? there is probably a character in the text that is causing trouble.

    check the end of the string that PHP gets, and then compare that to the text in C3 and see what is immediately after that point... if it is an '&' then it is telling php that the rest is a new parameter.

  • AllanR

    There truly was an "&" !!!

    I used URLencode for sending data and Urldecode when loading corresponding text file.

    I don't know what this url thing really does, but for now it seems to work!!!

    Maximum gratitude, friend!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)