This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('html5_image_upload.php'); | |
$file = get_xhr_file(); | |
// Original file name: | |
$name = $file['name']; | |
// Size of file: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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: { |