maful

data03.php

Feb 20th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. /*
  2. OK lantas bagaimana cara membuatnya? Caranya cukup mudah sekali, yaitu dengan hanya menambahkan atribut accept="..." pada tag input filenya.
  3.  
  4. Berikut ini contoh penggunaannya:
  5. */
  6.  
  7. <form method="post" enctype="multipart/form-data" action="upload.php">
  8.     Pilih File <input name="fileku" type="file" accept="image/*">
  9.     <input name="upload" type="submit" value="Upload">
  10. </form>
  11.  
  12. /*
  13. Contoh form di atas akan memfilter file-file image saja dalam proses browse file.
  14.  
  15. Selain menggunakan accept="image/*", kita bisa juga menggunakan accept="video/*" untuk memfilter file-file video
  16. */
  17.  
  18. <input name="fileku" type="file" accept="video/*">
  19. <input name="fileku" type="file" accept="audio/*">
  20. <input name="fileku" type="file" accept="image/gif">
  21. <input name="fileku" type="file" accept="image/gif,image/jpeg">
Advertisement
Add Comment
Please, Sign In to add comment