Advertisement
pepoflex

mfu_pd

Mar 2nd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. //adjuntar archivo
  2.     if(isset($_FILES['archivo']['tmp_name']) && $_FILES['archivo']['tmp_name'] != '') {
  3.         $random_filename = substr(md5(time()), 0, 9);
  4.         $ext = '.jpg';
  5.         if(strpos(strtolower($_FILES['archivo']['name']), '.png') > -1) {
  6.             $ext = '.png';
  7.         }
  8.  
  9.         $destFile = 'G:/PleskVhosts/midominio.pe/httpdocs/web/egresados/archivos_adjuntos/'.$random_filename.$ext;
  10.         move_uploaded_file($_FILES['archivo']['tmp_name'], $destFile);
  11.         chmod($destFile, 0777);
  12.        
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement