Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?
  2. // Prepara a variável do arquivo
  3. //Lembre-se do input name lá no form, cujo demos o nome de arquivo
  4.  
  5. $arquivo = isset($_FILES["arquivo"]) ? $_FILES["arquivo"] : FALSE;
  6. $tmp_name = $_FILES["arquivo"]["tmp_name"];
  7. $nome = $_FILES["arquivo"]["name"];
  8.  
  9. //Restrições do arquivo para até 10 MB
  10. $tamanho = 10485460;
  11. if($arquivo["size"] > $tamanho) {
  12. header('Location: grande.html');
  13. }else{
  14. copy($tmp_name, "/home/user/cliqinfo/public_html/arquivos/$nome");
  15. header('Location: ok.html');
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement