title: Unable to let user upload profile picture in sign up process (Parse.com/JS SDK)
body: <p>Using parse.com and the JavaScript SDK. The code should let a user sign up and upload a profile picture.</p>
  
  <p>Updated, this is the code I'm using that is returning an error when trying to sign up a user the console message <code>is Uncaught TypeError: Cannot read property 'length' of undefined</code></p>
  
  <pre><code>&gt; $('#SignUp').click(function(e) {
  &gt;     UserSignUp(); });
  &gt; 
  &gt; 
  &gt; function UserSignUp() {
  &gt; 
  &gt;     var user = new Parse.User();
  &gt;     userFirstname = $('#firstnamesu').val();
  &gt;     userLastname = $('#lastnamesu').val();
  &gt;     userUsername = $('#usernamesu').val();
  &gt;     userGender = $('#gendersu').val();
  &gt;     Email = $('#emailsu').val();
  &gt;     PWP = $('#passwordsu').val();
  &gt; 
  &gt;     user.set("FirstName", userFirstname);
  &gt;     user.set("LastName", userLastname);
  &gt;     user.set("username", userUsername);
  &gt;     user.set("gender", userGender);
  &gt;     user.set("email", Email);
  &gt;     user.set("password", PWP);
  &gt; 
  &gt; 
  &gt;      var fileUploadControl = $("#pic")[0];    if (fileUploadControl.files.length &gt; 0) {    var file =
  &gt; fileUploadControl.files[0];    var name = "photo.png";
  &gt; 
  &gt;    var parseFile = new Parse.File(name, file);
  &gt; 
  &gt;    //put this inside if {    parseFile.save().then(function() {    //
  &gt; The file has been saved to Parse.    }, function(error) {    // The
  &gt; file either could not be read, or could not be saved to Parse.
  &gt;     });
  &gt; 
  &gt;     // Be sure of ur parameters name
  &gt;     // prod is extend of my class in parse from this: var prod = new products();
  &gt;     user.set("ProfilePic", parseFile);
  &gt;     user.save();    } ////////////Runs parse after the SignUp button has been clicked by the user////////////////////
  &gt; 
  &gt; $('#SignUp').click(function(e) {
  &gt;     UserSignUp(); });
  &gt; 
  &gt;     user.signUp(null, {
  &gt;         success: function(user) {
  &gt;             if (!user.existed()) {
  &gt;                 window.location.href = "user_home.html";
  &gt;             } else {
  &gt;                 alert("NO WAY BUDDY");
  &gt;             }
  &gt;         },
  &gt;         error: function(user, error) {
  &gt; 
  &gt;         }
  &gt;     });
  </code></pre>