Skip to content

Instantly share code, notes, and snippets.

@cfree

cfree/array.js Secret

Last active August 29, 2015 13:56
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 cfree/a9ae8995d017d426696c to your computer and use it in GitHub Desktop.
Save cfree/a9ae8995d017d426696c to your computer and use it in GitHub Desktop.
Uploadifive HTML file-uploading plugin
$('#upload').uploadifive({
'uploadScript': 'upload.php',
'checkScript': 'check-exists.php',
'fileType': [
'image/png',
'image/jpg',
'image/jpeg',
'image/gif'
]
});
$('#upload').uploadifive({
'uploadScript': 'upload.php',
'checkScript': 'check-exists.php'
});
// Add allowable file types to form input
$('input[type="file"]').attr(
'accept',
'image/gif, image/jpeg, image/jpg, image/png, .gif, .jpeg, .jpg, .png'
);
// JSON encode file types
var types = [
'image/png',
'image/jpg',
'image/jpeg',
'image/gif'
],
typesJsonStr = JSON.stringify(types);
// ["image/png","image/jpg","image/jpeg","image/gif"]
$('#upload').uploadifive({
'uploadScript': 'upload.php?',
'checkScript': 'check-exists.php',
'fileType': typesJsonStr,
});
$('#upload').uploadifive({
'uploadScript': 'upload.php',
'checkScript': 'check-exists.php',
'fileType': '*.jpg;*.JPG;*.jpeg;*.gif;*.png'
});
$('#upload').uploadifive({
'uploadScript': 'assets/js/uploadifive/uploadifive.php',
'checkScript': 'check-exists.php',
'fileType': 'image/png'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment