rasteiras Posted July 24, 2012 at 12:06 AM Report Share #469874 Posted July 24, 2012 at 12:06 AM Alguem me consegue explicar porque não consigo fazer o upoad de um arquivo txt por favor? index.html <div id="menu"> <form enctype="multipart/form-data" action="upload.php" method="post"> Arquivo <input type="file" name="arquivo"size="20"><br/> <input type="submit" value="Enviar arquivo"> </form> </div> upload.php <?php include('includes/connect.php'); $name = $_FILES['arquivo']['name']; $type = $_FILES['arquivo']['type']; $size = $_FILES['arquivo']['size']; $temp = $_FILES['arquivo']['tmp_name']; $error=$_FILES['arquivo']['error']; if($error== 0) { $pasta='Formatos/uploads'; $upload= move_uploaded_file($temp,$pasta.$name); } ?> Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted July 24, 2012 at 12:12 AM Report Share #469876 Posted July 24, 2012 at 12:12 AM (edited) 1º mete o código sempre dentro das tags do geshi 2º altera o teu código da seguinte forma e diz o que te é apresentado <?php include('includes/connect.php'); $name = $_FILES['arquivo']['name']; $type = $_FILES['arquivo']['type']; $size = $_FILES['arquivo']['size']; $temp = $_FILES['arquivo']['tmp_name']; $error=$_FILES['arquivo']['error']; print_r($_FILES); if($error== 0) { $pasta='Formatos/uploads'; $upload= move_uploaded_file($temp,$pasta.$name); } ?> Edited July 24, 2012 at 12:13 AM by HappyHippyHippo IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ruimcosta Posted July 24, 2012 at 02:47 PM Report Share #470028 Posted July 24, 2012 at 02:47 PM Não te esqueças que a pasta para envias o ficheiro tem de ter permissões de escrita. Abraços e beijinhos,Rui Costa Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now