Hey guys i been trying all day to find a way to validate some upload files using javascript
// get values from FORM
var firstname = $("input#firstname").val();
var lastname = $("input#lastname").val();
var username = $("input#username").val();
var ImageFile= $("file#ImageFile").val();
var email = $("input#email").val();
var message = $("textarea#message").val();
var firstName = name;
if (firstName.indexOf(' ') >= 0) {
firstName = name.split(' ').slice(0, -1).join(' ');
}
$.ajax({
url: "mail/contact_me.php",
type: "POST",
data: {
firstname: firstname,
lastname: lastname,
username: username,
ImageFile: ImageFile,
email: email,
message: message
},
cache: false,
If i remove the var ImageFILE = $("file#ImageFile").val();
the script work i need this to send a attachment with phpmailer
my php is working my form is working great but if i try adding the java just die i think im doing something wrong here i never was really good on java any subjection?
The email is sent but the attachment is not getting there