Instantly share code, notes, and snippets.

View html5-image-uploader-example.php
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="html5-image-uploader.jquery.js"></script>
<script>
$(document).ready(function() {
$('#file').postFile({
url: 'http://example.com/upload',
data: {
View html5_image_upload.example.php
<?php
require_once('html5_image_upload.php');
$file = get_xhr_file();
// Original file name:
$name = $file['name'];
// Size of file:
View html5_image_upload.php
<?php
/*******************************************************************
* Get file sent by HTML5 FileReader/XHR
*******************************************************************/
function get_xhr_file()
{
$file_name = $_SERVER['HTTP_X_FILE_NAME'];
$file_size = $_SERVER['HTTP_X_FILE_SIZE'];
$file_type = $_SERVER['HTTP_X_FILE_TYPE'];
View html5-image-uploader.jquery.js
$(document).ready(function() {
var IS_IE = (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0);
$.fn.postFile = function(options) {
var $self = this;
var defaults = {
url: undefined,
type: "POST",
View Odbc.php
<?php
/**
* ODBC layer for DBO
* Helpful for Linux connection to MS SQL Server via FreeTDS
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)
*