hi fellas,
Im using javascript framework in uploading image via ajax but the problem is $_FILE is empty here s my code:
<form action="upload.php" method="post" enctype="multipart/form-data" id="upload" name="upload">
<input type="file" name="file" id="file" style="border:none"/></center>
</form>
js
var url = 'upload.php';
new Ajax.Request(url, {
method: 'post',
contentType: 'multipart/form-data',
encoding: 'UTF-8',
parameters: $('upload').serialize(true),
onSuccess: function(transport) {
var notice = $('error');
if (transport.responseText=='success'){
alert('success');
}else{
alert(transport.responseText);
}
}
});
php
echo $_FILES["file"]["name"] // is empty....
uploading script here....