2
I have the following code below:
PHP:
<?php
$nome_temporario = $_FILES["Arquivo"]["tmp_name"];
$nome_real = $_FILES["Arquivo"]["name"];
copy($nome_temporario, "/public_html/publico/$nome_real");
?>
HTML:
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="Arquivo" id="Arquivo"/>
<input type="submit" value="Enviar"/>
<input type="reset" value="Apagar"/>
</form>
I would like to know what is wrong, because when I try to upload, it appears this error message:
Warning: copy(/public_html/publico/teste.txt) [Function.copy]: failed to open stream: No such file or directory in /home/opeao802/public_html/upload/upload.php on line 4
I have general access, and running the code inside the server, it’s all released on the Cpanel. The folder does exist, but I don’t know why it can’t copy inside '-'
– Ramon Ruan
see the edited response
– Alan Rezende
I tried, it no longer appeared error message, but also did not upload T.T file
– Ramon Ruan
which of the options you used? test using the
/home/opeao802/public_html/publico/
to ensure– Alan Rezende
this option even I used.
– Ramon Ruan
I don’t see any more errors, some new message or Warning appears?
– Alan Rezende
I had put public or instead of public in the answer, by chance you don’t have a public folder so the file might be inside it
– Alan Rezende
no, I had noticed, but I didn’t change anything. all right as the folders
– Ramon Ruan
If not already, test put permission
777
in the folder p view– Alan Rezende
face, now that I saw it, he copied to the previous folder the folder I informed. I wonder what happened?
– Ramon Ruan
All right old man, I missed the same path.
– Ramon Ruan
Set as your code is now
– Alan Rezende
Blza q good q worked
– Alan Rezende