Skip to content

Instantly share code, notes, and snippets.

@shrimpwagon
Created April 20, 2017 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrimpwagon/0bc0a0a70a921d55529a49d141954b53 to your computer and use it in GitHub Desktop.
Save shrimpwagon/0bc0a0a70a921d55529a49d141954b53 to your computer and use it in GitHub Desktop.
<?php
require_once('html5_image_upload.php');
$file = get_xhr_file();
// Original file name:
$name = $file['name'];
// Size of file:
$size = $file['size'];
// File type (mime):
$type = $file['type'];
// Temporary file path (get binary file from here):
$file_raw_data = file_get_contents($file['path']);
// Miscellanous data sent from form:
$object = $file['data'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment