JustCallum's Forum Posts

  • Thanks you so much. I was gonna write it using a bunch of stuff but you made a simpler way.

  • fi866yiec826ze/W1-1

    I want it to become

    W1-1

    fi866yiec826ze

    how would I do this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a code that gets data(png,jpg and stuff) and save it as a file.

    <?php
    	// requires php5
    	header('Access-Control-Allow-Origin: *');
    	define('UPLOAD_DIR', 'static/images/');
    	$img = $_POST['img'];
    	$img = str_replace('data:image/png;base64,', '', $img);
    	$img = str_replace(' ', '+', $img);
    	$data = base64_decode($img);
    	$file = UPLOAD_DIR . uniqid() . '.png';
    	$success = file_put_contents($file, $data);
    	print $success ? $file : 'Unable to save the file.';
    ?>[/code:1cocpr8o]
    
    The host is DataServer.Airwavestudio.co.uk/<pathhere>  the path here is removed as it can be used to post stuff if gotten hold off.
    
    [img="http://i.gyazo.com/35ad299403b8690b4fd7c39b3414d2a9.png"]
    raw:     "type='base64'&image=" & URLEncode(RegexReplace(CanvasSnapshot, "data:image/png;base64,", "", ""))
    but everytime it gets posted it makes a 0x0 png file. 
    So what am I doing wrong?