Skip to content

Instantly share code, notes, and snippets.

@sotarok
Created August 28, 2010 17:08
Show Gist options
  • Save sotarok/555349 to your computer and use it in GitHub Desktop.
Save sotarok/555349 to your computer and use it in GitHub Desktop.
<?php
$hash = md5($_POST['imagedata']);
file_put_contents("uploads/$hash", $_POST['imagedata']);
$db_filename = "db/id.db";
$db = unserialize(file_get_contents($db_filename));
$db[$hash] = $_POST['id'];
file_put_contents("db/id.db", serialize($db));
echo "http://gyazo.hostname/uploads/$hash";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment