Search Unity

Writing to raw files - text, json, etc - on the internet.

Discussion in 'Multiplayer' started by mzeeque, May 26, 2020.

  1. mzeeque

    mzeeque

    Joined:
    Apr 8, 2015
    Posts:
    3
    As the title says, I'm looking for a way to write to text or json files on the internet. It is fairly easy to retrieve data from raw json file saved on my google drive using webrequest, but I dont know how to write to json or text file (hosted on my google drive). I've seen some tutorials, but they use php, and I don't really have a good knowledge of databases. So please tell me a way to do this, and if it requires learning a bit about databases and php etc., then please share links to some tutorials. Thanks!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I'm pretty sure Google Drive requires authentication in order to write. I'm guessing that would be a mess to manage adding all sorts of random users being allowed write access, but you can look through the Google Drive API to see what is available.

    https://developers.google.com/drive/api/v3/about-sdk

    I'm also guessing that a database would be the correct solution to whatever you are trying to do though. If you're talking about all your clients writing to the same file on your Google Drive then you are going to have to deal with the case where several are trying to do so at the same time. If I was going to do that I'd create a single server which writes to the file, and all your clients connect to the server. That way your custom server build is the only one writing to the file, and can manage multiple client requests itself without damaging the file. But by the time you do all that work you'll almost certainly find that you would have saved a whole lot of time writing a simple PHP front end for a MySQL database.