*urgent* Download (and parse) file from URL.

0 favourites
  • 6 posts
From the Asset Store
Source File, music and art pack for Android Negotiator
  • Hello, guys. I have decided to attempt to make a dynamic news application in one or two days as a project for my school, which would download a file from dropbox (through the public link) containing information about articles and links to them/any images that are used.

    The problem i am facing, however, is getting the files to download seamlessly (without alerting the user, at least no prompts) and then parsing them.

    So, my questions are:

    1.) Is there a way one can download a file from a URL regardless what platform the export is done on (android, website) and (later) parse it as a text string, line by line, without modifying the parameters of the hosting server (e.g. i have no access to modifying those http headers on dropbox)?

    2.) How would one parse such a file in C2, by reading it line by line (is there a way to retrieve the line count of a string and then do a loop from 1 to stringcount, then retrieving the text for each line of the file, for it to be interpreted)?

  • If you host the information yourself on a site, and are able to put it in a mysql database, you could easily fetch its information through ajax.

    You could make a ittle php web app to serve a content manager/adder for the news, and a application in cs2 to retrieve the information.

  • The goal is to use Dropbox as the main storage place for the files (i doubt that i have time for anything else). Is there a way to do exactly what i described, without having to resort to workarounds so soon?

  • It appears that i have gotten the AJAX functionality to work (at least it seems to function when i test it through chrome with C2's preview function), however it appears that AJAX does not support UTF-8 text encoding. Is there a way around this, such as using one of the compress plugins (deflate, base32) to compress the text and afterwards decompress it? Would this work? What else is there to do?

  • What about parsing xml ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I want to have my own custom syntax, having xml layered on top of it seems like a hassle. Also, i think i fixed it - Notepad++ has another encoding set by default, and although it displays UTF-8 characters just fine (somehow), this causes problems with AJAX. Holy hell, i actually managed to do this.

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