Can someone please help me to debug the php code in the post at https://www.sitepoint.com/html5-ajax-file-upload/ . PHP script here is no longer able to upload the file.
I tried this with my local server but the file is not uploading in upload folder.
Thanks in adv.
This tutorial is old. In file filedrag.js
there is function function UploadFile(file) {....}
in that change
xhr.setRequestHeader("X_FILENAME", file.name);
to
xhr.setRequestHeader("X-FILENAME", file.name);
since underscores are deprecated in later Apache releases, and ignores it, so there is error which is seen in console. For more (refer Header names with underscores ignored in php 5.5.1 / apache 2.4.6 )
After changing it will upload to respective directory