Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ext = array('jpg', 'gif', 'mpg', 'mpeg', 'png');
- $destpath = 'galerije/';
- $files = count($_FILES['file']['name']);
- for($i = 0; $i < $files; $i++)
- {
- if(in_array(pathinfo($_FILES['file']['name'][$i], PATHINFO_EXTENSION), $ext))
- {
- if(move_uploaded_file($_FILES['file']['tmp_name'][$i], $destpath . $_FILES['file']['name'][$i]))
- {
- // Success
- }
- else
- {
- // Failure
- }
- }
- else
- {
- // Extension not allowed
- }
- }
Add Comment
Please, Sign In to add comment