How do I: 1.make URL-checking system; 2.localfile's paths

0 favourites
  • 5 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • The first part is about URL-checking system.

    What do I have?

    A list of URLs

    What do I need?

    Check every URL:

    1. It is an IMAGE

    2. There is no request errors on it

    Result?

    If they are all images and there are no errors - message 'All is OK'

    On any error - mark bad URLs with error type (not an image or 404 or ...)

    ----------

    The second part is about localfile's links

    What do I have?

    Several files on disk. Platform may be Browser, PC, Android, iOS.

    What do I need?

    1. Take path for every file like an URL or with other method to have access to them at any time with this link.

    2. Not to take path if it is not an image

    Common result is:

    save list of urls and file paths to a file

    I will attach my project file soon, you'll see what I have done (can't do it right now). But I can't make it to be universal for every platforms. Also I'll write you my problems. I've tried to make it for several hours, and no good results..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What do I have?

    Several files on disk. Platform may be Browser, PC, Android, iOS.

    What do I need?

    1. Take path for every file like an URL or with other method to have access to them at any time with this link.

    2. Not to take path if it is not an image

    The links most likely wont be like URLs.

    If you take the files from your local storage of the device running the app for file recognition, you would get links to local files, and not widely accessible URL links. The construct 2 app is not a server.

  • lennaert

    With FileChooser I can take a FileChooser.FileURLAt(0) after picking the file.

    But if I store this "URL" and then will try to access file with this link in another session - it's a bad way. Because it will be incorrect link.

    On the other way FileChooser.FileNameAt(0) gives just a filename and no path to it. So I can't find this file next time knowing just its name even in this session..

    I need to save some path to local file to access it in any session (of course with condition that file is in its place)

    In NodeWebkit it's easy. What about other platforms?

  • FileURLAt(loopindex) isnt a real path/url .. its a blob of characters representing the entire file.

    In a project for multiple file uploading, I use an array to store the entire files, perhaps this is something for you ....

    The following requires rojohounds paster

  • lennaert I'll take a look at this right now and tell you about results!

    ----- UPDATE

    WOW! Paster.imgURL works more-more-nore faster than Sprite.ExtractImage.currentImage behavior "Extract sprite to base64 string" by Pode

    I've just made an experiment on one of files:

    Paster - about 1..1,5 seconds

    ExtractImage - about 10..11 (!!!) seconds

    I will use Paster for now! Thank you very much for your time and help!!

    And with jsZIP plugin by Noncentz705 I can now zip all this image data to one file and reload it any time I want

    The only difference is that base64 format often has bigger weight. For example, my uploaded 53 kB JPEG converts into 300 kB PNG

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