Skip to content

Instantly share code, notes, and snippets.

@cfjedimaster
Created July 10, 2013 13:26
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 cfjedimaster/5966264 to your computer and use it in GitHub Desktop.
Save cfjedimaster/5966264 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var parseAPPID = "x";
var parseJSID = "x";
//Initialize Parse
Parse.initialize(parseAPPID,parseJSID);
console.log("Parse init");
$("#fileUploadBtn").on("click", function(e) {
var fileUploadControl = $("#fileUploader")[0];
if (fileUploadControl.files.length > 0) {
var file = fileUploadControl.files[0];
var name = "photo.jpg";
console.log("here goes nothing...");
var parseFile = new Parse.File(name, file);
parseFile.save().then(function() {
console.log("Woot!");
console.dir(arguments);
}, function(error) {
console.log("Error");
console.dir(error);
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment