I need to upload text file from the local machine to the server. The problem is I'm getting only file name, but not the contents. Here is my script:
PHP Code:
printf("<TABLE>\n");
printf(" <TD NOWRAP>\n");
printf(" <FORM NAME=\"UplForm\" METHOD=\"POST\" ENCTYPE=\"multipart/form-data\" ACTION=\"upload.php\" AUTOCOMPLETE=off>\n");
printf(" <TD>\n");
printf(" File to upload:\n");
printf(" </TD>\n");
printf(" <TD>\n");
printf(" <INPUT TYPE=file ACCEPT=\"text/plain\" NAME=\"upfile\" SIZE=\"40\" VALUE=\"Browse\">\n");
printf(" </TD>\n");
printf("</TABLE>\n");
printf(" <INPUT TYPE=submit VALUE=\"Upload file:\">\n");
printf(" </FORM>\n");
And all I get in the upload.php script is $upfile = “filename.txt”.
All functions like filesize, file_exists return nothing.
What I'm doing wrong?