class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
var fileInput = document.getElementById('the-form');
form.onsubmit = function() {
var file = fileInput.files[0];
var formData = new FormData();
formData.append('file', file);
var xhr = new XMLHttpRequest();
// Add any event handlers here...
xhr.open('POST', form.getAttribute('action'), true);
xhr.send(formData);
return false; // To avoid actual submission of the form
}
I'm trying to make an image/s upload without refreshing the page with the class.upload.php but i can't solve it. Every time i do this i'm getting some errors and the main error is : Notice: Undefined index: file in C:\wamp\www\OP\admin\test\upload.php on line 6 Warning: Invalid argument supplied for foreach() in C:\wamp\www\OP\admin\test\upload.php on line 6
Any help with this issue? any suggestions or past experiences that could solve this is welcome. Thanks.Reply
And i have this Ajax script:
I'm trying to make an image/s upload without refreshing the page with the class.upload.php but i can't solve it. Every time i do this i'm getting some errors and the main error is :
Notice: Undefined index: file in C:\wamp\www\OP\admin\test\upload.php on line 6
Warning: Invalid argument supplied for foreach() in C:\wamp\www\OP\admin\test\upload.php on line 6
Any help with this issue? any suggestions or past experiences that could solve this is welcome. Thanks.