Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="pt-br">
- <head>
- <title>Upload de Arquivos</title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
- </head>
- <div class="container">
- <body>
- <br><br>
- <center><h1>Upload de Arquivos</h1></center>
- <form method="POST" action="" enctype="multipart/form-data" name="upload">
- <input type="file" name="arquivo" id="arquivo">
- <input type="submit" name="enviar" value="Fazer Upload">
- </form>
- <?php
- if (isset($_POST["enviar"])){
- $arquivo = $_FILES["arquivo"];
- echo "<pre>";
- print_r($arquivo);
- echo "</pre>";
- if (move_uploaded_file($arquivo["tmp_name"], "arquivos/".$arquivo["name"])){
- echo "<font color='green'><b>Arquivo enviado com sucesso</b></font><br> ";
- echo "<a href='"."arquivos/".$arquivo["name"]."' target='_blank'><img src='"."arquivos/".$arquivo["name"]."' width='100' heigh='100'></a>";
- } else{
- echo "<font color='red'><b>Arquivo não foi enviado</b></font>";
- }
- }
- ?>
- </body>
- </div>
- </html>
Add Comment
Please, Sign In to add comment