无法将用户文件发送到WordPress上的php脚本


Unable to send a user file to php script on wordpress

在主页上,我接受了文件输入,即

form action = "Results" method = "post"
 input type = "file" name="file_name"
 input type = "submit" value="Upload"
/form 

在结果页面上,我编写了一个php代码来读取其内容。

?php
$file = $_POST["file_name"];
$fp = fopen($file, 'r');  
if($fp == NULL){
    echo '<h2> File not found !!!</h2>';
}
else {
   $line = fread($fp,filesize($file));
        ...
     }
fclose($fp);
?

好吧,代码在XAMPP上运行得很好,但是当我尝试在我的网站上运行它时,它会显示此错误。

*Warning: fopen(004.txt) [function.fopen]: failed to open stream: No such file or directory in /home/u795370533/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 439 **File not found !!!***
*Warning: fclose() expects parameter 1 to be resource, boolean given in /home/u795370533/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 652*

我已经在我的网站上安装了exec-php插件,但我无法找出错误。

听起来像

1) No any file was uploaded to the temp directory
2) You have to check the upload_max_filesize of your server. (run phpinfo() and check)
3) Just `print_r($_FILE)` to check what is the error?