c0105's Forum Posts

  • Allright, thank you

  • bump..

  • Same here, nothing happens in Chrome unless it's a link from SoundCloud, very strange.

    If I take a picture from google or just any other website, nothing happens..

    Mhm, hopefully someone has a solution.

  • Hey,

    I'd like to let the user choose a file from their PC and then use the selected file as sprite in the game.

    I think I've heard someone do this before on the forum, but I'm not sure..

    Is it possible?

    Thanks in advance,

    Chris

  • Oh I see.

    Would be nice if there is a way to include it though :s

  • Hey,

    I'm using Pode's HTML plugin including the iFrame.

    The iFrame is a big thing for the application, so it needs to be included when taking a snapshot. It does not.

    When the snapshot is taken, everything is there except the iFrame. It's just invisible.

    Is there any way I can include that? It's kinda necessary.

    Thank you,

    Chris

  • It's hosted by 3owl.com, so it's not a private server.

    If there would be read and write issues, what could the title be? I mean, I have a lot of options when going to my server dashboard, such as FTP Access, DNS, PHP options etc.

  • For some reason it keeps uploading blank images, although I did thange CanvasSnapshot to "photo="&CanvasSnapshot instead.

    Could there be something wrong with my server? Something I have to setup? I actually changed PHP version from 5.3 to 5.4, didn't make a difference though...

    I checked upload.php and it is the EXACT same as yours, directory is just licagr_photos.

    This is just weird. Any ideas?

  • Hello.

    This should be the PHP file that you need.

    It worked for me, make sure you have a folder where the PHP file sits named "user_photo", or change the directory name.

    <?php

    chdir('');

    $img = $_POST['photo'];

    define('UPLOAD_DIR', 'user_photo/');

    $img = str_replace('data:image/jpeg;base64,', '', $img);

    $img = str_replace(' ', '+', $img);

    $data = base64_decode($img);

    $file = UPLOAD_DIR . uniqid() . '.jpeg';

    $success = file_put_contents($file, $data);

    ?>

    I tried out your code, unfortunately also resulting a blank JPEG.

    I made a sample .capx of what I've done, so if you have time to check it out, that would be awesome.

    Links for my server:

    upload.php: aalic1nrf.3owl.com/upload.php

    photo directory: aalic1nrf.3owl.com/licagr-photos

    The PHP code is the exact same as you posted, except I changed the directory folder.

    By going to /upload.php it actually says;

    Warning: chdir(): open_basedir restriction in effect. File() is not within the allowed path(s): (/home/u393737372:/usr/lib/php:/tmp) in /home/u393737372/public_html/upload.php on line 3

    I guess that does not matter since it's just a warning?

    .CAPX download: mediafire.com/download/2m5of2be0gvflba/snapshot.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for sharing your code, I will try it out tommorow!

  • Hello,

    I've been playing around trying to figure out how to save a snapshot on my server. I know this can be done with PHP, just not sure how since I'm not a programmer myself. I have tried following muschalski's tutorial, resulting a blank JPEG located at /licagr-photos on my server.

    Basically, when a button is clicked or tapped it will take the snapshot, contact a PHP script located at my server (/upload.php) via AJAX (post to url).

    I just need the PHP script. Sadly, I cant pay you since I'm poor, though I can give you credit in the finished product, including a link to your profile/social network if you want :)

    If you have any questions, throw 'em at me.

    Happy holidays!

    Chris

  • I'm not sure what your problem is. Can you explain in another way? I have your test game installed.

  • I'll give you a DL later when I get home.

    I would love a feature to check if something is in the text box or not. Can this be implemented?

  • " Javascript error!

    Uncaught TypeError: Object #<Object> has no method

    'equals_nocase'

    localhost:50000/AdvTextBox_plugin.js, line 405 (col 13) "

    Not sure what's causing this?

    EDIT: Actually, I just found out what the problem is.

    I have a condition: if Text is: "" (- that is to check if nothing is in the text box). Can this be fixed?

    By the way, "Validated" means that there just is something in the text box right?

  • Thanks sosensible that works 100%!