Skip to content

Instantly share code, notes, and snippets.

@fivestar
Created June 16, 2010 17:03
Show Gist options
  • Save fivestar/440962 to your computer and use it in GitHub Desktop.
Save fivestar/440962 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>wozozo...</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.upload.js"></script>
<style>
<!--
-->
</style>
</head>
<body>
<div id="box">
<input type="file" name="photo" id="photo" />
</div>
<div id="result">
</div>
<script>
//<![CDATA[
jQuery(document).ready(function($) {
$('#photo').change(function(event) {
$(this).upload('/wozozo/up/up.php', function(files) {
var text = '';
for (var name in files) {
text += '[' +name + "]<br />";
for (var key in files[name]) {
text += key + ': ' + files[name][key] + "<br />";
}
}
$('#result').html(text);
}, 'json');
});
});
//]]>
</script>
</body>
</html>
<?php echo json_encode($_FILES) ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment