How do I download file/image in C2 file folder ?

0 favourites
  • 6 posts
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • Hi!

    I'm wondering if it's possible to download images into C2 file folder.

    The mechanic is:

    From a C2 game (wrapping in Android apk with XDK)

    ->Download image files from server

    ->Save into file folder of C2

    Then, when the game need it:

    ->Sprite -> Load Image from URL: "ID_IMAGE.jpg"

    Maybe it's possible to save image from sprite into file folder, during the game ?

    If it would be possible, I can do this:

    -> Sprite -> Load Image from URL: "http://www.server.com/ID_IMAGE.jpg"

    -> Save img from sprite into c2 file folder

    Then: Sprite -> Load Image from URL: "ID_IMAGE.jpg"

  • [quote:t54dm7en]rexrainbow said: Sorry, I had no idea about that, you might try ask to cranberrygame .

    [quote:t54dm7en]cranberrygame said: You can use following plugin.

    Phonegap FileTransfer: download or upload file to your server. (http file download and upload)

    see more: https://plus.google.com/102658703990850 ... QceTB8MGfs

    cranberrygame, thanks for your answer,

    What I want is not to transfer a file on a server, but put the images in a C2 "cache", in order to not download it again if they are in the app cache.

    I see the function "Phonegap File: read, write file.. get directory entries and create directory...".

    Isn't it possible to make a "cache" with this one ?

    Where is it possible to write file and directory ?

  • amkp

    You can also check file exists or not by using Phonegap File.Check if file exists action.

    Thanks

    Sang Ki Kwon

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This tutorial I wrote might just help https://www.scirra.com/tutorials/1457/s ... os-android

    I explain how to save an image (in this case a screenshot) using webstore. And with a bit of tinkering it should be able to fit what your after.

  • Thanks ,

    Your tutorial is a good idea.

    But I have doubts about using the webstorage in this case.

    Webstorage is size limited, I don't remember how much.. maybe, 5Mo ?

    The image is surely stocked in Base64 type, who has superior size than file format.

    So, for one image that's maybe ok, but for hundreds of images, I think that's impossible...

  • Yeah, its pretty limited with the save if I remember correctly. Sorry I couldn't help, will give it some more thought though. Good luck!

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