How do I save a json file on the server?

0 favourites
  • 9 posts
From the Asset Store
Source File, music and art pack for Android Negotiator
  • I know how to do this on my machine but I don't know how to save it on the server. Is it possible?

  • you can make a script in PHP that you will send the JSON data with the POST in AJAX, and a script in PHP that take the value and build the file .json where you want in the server...

    try to find on internet "make .txt/json file in php"

    this works for me very well, I don't know if there is a method to upload directly the file, I mean, save on the cache and after send the file to a specific folder, but I think is more safe with the first method

  • Hey Thanks but I what I found is very specific. Do you have an example to show me? Something that worked for you would be fine.

  • UP

  • BUMP!

  • $sql = "insert into `yourtablename` ('$yourtablerow) values ($yourvalues) where `yourvariable`=`yourvarisble1

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want a text file in a json format not a db. Thanks anyway.

  • on server you need php script:

    $txt = $_POST['data'];
    $myfile = fopen($name.".txt", "w") or die("Unable to open file!");
    fwrite($myfile, $txt);
  • Hey korbaach. Thank you. You are a true life saver.

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