Skip to content

Commit

Permalink
Clean-up for README file (jfeldstein#29)
Browse files Browse the repository at this point in the history
Thanks for contributing!


* Renamed README->README.md

* Changed README tags to MarkDown, improves appearance of README on GitHub

* Added valid_extensions to the MORE example

* Added HTML example

* Modernized JavaScript object syntax

* Added name attribute to HTML example
  • Loading branch information
r-barnes authored and jfeldstein committed May 26, 2016
1 parent dd2464f commit 3cc7d82
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,38 @@ response to a callback, nothing else.
- It does not require your server to respond in any particular way
- It does not matter how many files you use, or where they are on the page

-- Use as little as --
**Simple HTML**

<input type="file" id="one-specific-file" name="one-specific-file">

**Use as little as**

$('#one-specific-file').ajaxfileupload({
'action': '/upload.php'
action: '/upload.php'
});

-- or as much as --
**or as much as**

$('input[type="file"]').ajaxfileupload({
'action': '/upload.php',
'params': {
'extra': 'info'
action: '/upload.php',
valid_extensions : ['md','csv'],
params: {
extra: 'info'
},
'onComplete': function(response) {
onComplete: function(response) {
console.log('custom handler for file:');
alert(JSON.stringify(response));
},
'onStart': function() {
onStart: function() {
if(weWantedTo) return false; // cancels upload
},
'onCancel': function() {
onCancel: function() {
console.log('no file selected');
}
});


* Copyright (c) 2011 Jordan Feldstein
Copyright (c) 2011 Jordan Feldstein

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down

0 comments on commit 3cc7d82

Please sign in to comment.