Hi;
$(document).ready(function (e) {
$('#imageUploadForm').on('submit',(function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
type:'POST',
url: $(this).attr('action'),
data:formData,
cache:false,
contentType: false,
processData: false,
success:function(data){
console.log("success");
console.log(data);
},
error: function(data){
console.log("error");
console.log(data);
}
});
}));
$("#ImageBrowse").on("change", function() {
$("#imageUploadForm").submit();
});
});
move_uploaded_file($_FILES['file']['tmp_name'], '/uploads');
I get
move_uploaded_file(/uploads): failed to open stream: Permission denied
I understand this is a permissions issue. How can I change the permissions with PHP, perhaps before move_uploaded_file? Chmod didn't work.
Thanks