Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2. $array = array("12345" => "guarana.jpg");
  3.  
  4. $titulo = "Aula 17 - Download de arquivo";
  5.  
  6. $idArquivo = $_GET['id'];
  7. header("Content-type: image/jpeg");
  8. header("Content-Disposition: attachment; filename=refri.jpg");
  9.  
  10. //the image is in the folder arquivos/guarana.jpg
  11. readfile("../arquivos/".$array[$idArquivo]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement