Location: PHPKode > projects > INTELIMEN - WYSIWYG HTML Browser Editor > editor/pg.image.upload.php
<?include(dirname($SCRIPT_FILENAME)."/lib.editor.inc.php");
if (!empty($arq) and ($arq!='none')){
  $arq_name = strtolower(strtr($arq_name,"àáâäãèéêëìíîïòóôöõùúüûçÀÁÂÄÃÈÉÊËÌÍÎÏÒÓÔÖÕÙÚÜÛÇ '\"","aaaaaeeeeiiiiooooouuuucAAAAAEEEEIIIIOOOOOUUUUC___"));
  $arq_ext  = substr(strrchr($arq_name,'.'),1);
  $test_ext = strpos(','.$arq_vald_ext,$arq_ext);
  if (!$test_ext)                      $up_error = $lang[erro_ext]."($arq_vald_ext)";
  if ($arq_max_size<$arq_size)         $up_error.= $lang[erro_maxsize]."($arq_max_size)";
  if (is_file($upload_abs.$arq_name))  $up_error.= $lang[erro_exist];
  if (!$up_error){
    $upload_abs = "../../img/";
    copy($arq,$upload_abs.$arq_name);
    $arq_script = "
      parent.ipreview.location = '$upload_url".rawurlencode($arq_name)."';
      parent.ifiles.location.replace('pg.image.list.php');";
  } else {
    $arq_script = "alert('$up_error');";
  }
}
echo "
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>
<html>
<head>
  <link rel='stylesheet'  type='text/css' href='styles.editor.inc.css'>
</head>
<body class='dlg' topmargin='0' leftmargin='0' scroll='no'>
<FORM METHOD='POST' ENCTYPE='multipart/form-data' name='upload' action='pg.image.upload.php'>
  <A class='dlg'>{$lang[file]}</A>
  <INPUT class='dlg' style='width:240; height=20' title='{$lang[file]}' name='arq' type='file' size='10'>
  <INPUT class='dlg' style='width:50;' title='{$lang[upload]}' name='submit' type='submit' value='{$lang[upload]}'>
</FORM>
  <script language='javascript'>
    $arq_script
  </script>
</body>
</html>";
?>
Return current item: INTELIMEN - WYSIWYG HTML Browser Editor