Dynamic Image request troubles (AJAX, Dropbox...!?)

0 favourites
From the Asset Store
Elevate your games with our AI Chatbot Integration! Seamlessly connect your Construct 3 projects with GPT-4 for dynamic,
  • New update: tried to convert the base64 string to binary and store it this way, but still no joy! Firebug is loving it; still thinks that it is 200 OK!

    //Just FYI - code used to convert base64 to binary
    $importedData = $_POST['BASE64'];
    $str = $importedData;
    base64_decode($str);
    $qz = "INSERT INTO `user_images`(`base64_string`) VALUES (".$str.")" ;[/code:46snnak0]
    
    Edit: Update update: copying and pasting the base64 string manually into the database works! So it isn't our database, it isn't my PHP file, and Firebug still seems to think it is all working okay.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just an update; I am testing a new approach using the Dropbox plugin by septeven. Still having issues however... Really starting to hate this application I'm building! One brick wall after another that I'm banging my head against!

    So. New approach.

    Live here: http://dev.angelserver.in/IMG_Sharing/

    This is what happens:

    • On hitting the 'test' button, a snapshot is taken of the layout.
    • To prove that a snapshot has been taken, this is loaded into an empty sprite.
    • This image is then created on Dropbox, using the data from the CanvasSnapshot:
    • Then, to prove that the file has successfully been created in Dropbox, we load the created file into another empty Sprite.

    ...So. The snapshot has been taken, as this is successfully loaded into the first empty sprite. Check the Dropbox? Yes, the file has been created. Good.

    But the resultant image is not loaded into the second empty sprite, suggesting that a problem has occurred at the upload stage. Check the Dropbox again, open the file:

    And sure enough, upon downloading the file, it appears to be corrupt. Something appears to be going wrong at the saving/upload stage, but I'm not sure what. There *is* data within "CanvasSnapshot" to be uploaded, however it does not seem to be transferring to the created file on Dropbox.

    Of course, the sharing functions then also do not contain images, because they reference the created file on Dropbox which contains a faulty file.

    Even stranger is that upon clicking the "Test" button again, an image IS loaded into the second empty sprite - but not of the current Snapshot. I fail to understand where it is getting this data from - it appears to be the last CanvasSnapshot - is it loading the previously saved file?

    Not sure what's going on, it's all a bit of a mess.

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