AJAX - Download as binary file

0 favourites
  • 5 posts
From the Asset Store
Excel2JSON
$1.20 USD
60% off
Convert multiple Excel files into JSON files and import them into construct3.
  • Hello again! I have attempted to create an auto-updater for my game 'ROCKETS <img src="smileys/smiley35.gif" border="0"> EVERYWHERE', and so far everything is responding correctly, until I finish downloading a file (like a .zip or a .png) and it's corrupt; full of unrecognizable characters.

    Based on minimal research, it turns out that javascript variables store info as ASCII and it can't recognize most binary characters used.

    Is there a way to get AJAX to download as Binary and not ASCII or Unicode? If not, is there a way around this problem?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Doable yes, but not naturally in C2 right now and I can't imagine will be real soon. You can try the Base64 plugin in the plugins section of the forum.

    However what you are looking for are these

    ToBase64 which is done prior to AJAX sending

    ToBinary which is done once you received the AJAX parts of the fine.

    base64decode.org

    maybe some where here will have some tools where you can make an Encode and Decode plugin for data files.

  • Interesting. I'll mess around with base64 encoding/decoding and see if it does anything different. I think the Extra Expressions plugin has this built-in, which is nice. :)

    Thank you again!

  • Web games auto-update by themselves so you shouldn't have to make your own updater. More in this tutorial: https://www.scirra.com/tutorials/70/offline-games-in-construct-2

  • This looks very useful, but after reading it, I realized that this is for web-based apps. I feel embarrassed about not mentioning this to start with, but I'm distributing the game via Node-Webkit.

    Is it still possible to use this functionality when native, or no? I noticed there is no trace of an offline.appcache file, so I'm assuming no. Either way, I appreciate the help and I'm really enjoying Construct 2. :)

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