Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Configuration - Your Options
  2. $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); // These will be the types of file that will pass the validation.
  3. $max_filesize = 524288; // Maximum filesize in BYTES (currently 0.5MB).
  4. $info =pathinfo($_FILES['userfile']['name']);
  5. $name = basename($_FILES['userfile']['name']);
  6. $ext = $info['extension'];
  7. $upload_path = 'upload/' . $user . '/'; // The place the files will be uploaded to (currently a 'files' directory).
  8.  
  9. $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
  10. $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement