我正在尝试将文件从Android应用程序上传到http服务器并收到此错误。有解决方案吗

时间:2013-02-23 19:39:45

标签: php

当我尝试通过浏览器访问PHP文件(位于服务器上)时,出现以下错误:

C:\xampp\htdocs\android_im\handle_upload.php

<?php 
    $target_path = "./";
    $target_path = $target_path . basename($_FILES['uploadedfile']['name']);

    if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
    {
        echo "The file ". basename($_FILES['uploadedfile']['name']) ." has been uploaded";
    }
    else 
    {
        echo "There was an error uploading the file, please try again!";
    }
?>

浏览器错误:

Notice: Undefined index: uploadedfile in C:\xampp\htdocs\android_im\handle_upload.php      on line 3

Notice: Undefined index: uploadedfile in C:\xampp\htdocs\android_im\handle_upload.php on line 4

There was an error uploading the file, please try again!

0 个答案:

没有答案