move_uploaded_file can not get a file

2

Hello, move_uploaded_file can not get a file.

        echo "  <form  method=\"post\" enctype=\"multipart/form-data\" action=\"testar_formato.php\" id=\"upload-container\" class=\"fileUpload\">
                <span>Upload</span>
                <input id=\"arquivo\" class=\"upload\" type=\"file\" />
                <br>
                <input id=\"enviar\" type=\"submit\" />
            </form>"; 

This file here:

        echo "  <form action=\"testar_formato.php\" id=\"upload-container\" class=\"fileUpload\">
                <span>Upload</span>
                <input id=\"arquivo\" class=\"upload\" type=\"file\" />
                <br>
                <input id=\"enviar\" type=\"submit\" />
            </form>";

Give this error:

And this is line 2:

$arquivo_up = $_FILES['arquivo']['name'];
    
asked by anonymous 05.05.2015 / 22:03

1 answer

1

Add the name attribute to your input :

<input id=\"arquivo\" name=\"arquivo\" class=\"upload\" type=\"file\" />

    
05.05.2015 / 22:07