$MAXW=1600;$MAXH=1200;$MAXS=1920000;
function prompt($m)
{echo("
".$m."
");}
?>
MetaVector CNC Free OnLine DXF to Gcode Converter
include(getenv("DOCUMENT_ROOT")."/header.htm");?>
$fdtrue=0;unset($loaded);
// $ch = curl_init();
//curl_setopt ($ch, CURLOPT_URL, "http://www.mygateoperator.com/cgibin/metavector/sample.dxf");
//curl_setopt ($ch, CURLOPT_HEADER, 0);
//curl_exec ($ch);
//curl_close ($ch);
if(isset($sample))
{prompt("This is a sample. Click new to upload other DXF files.
Or, make changes, then press Replot.");
$iext=".dxf";
$fname=uniqid("");
copy("./sample.dxf","tmp/".$fname.".dxf");
$fdtrue=1;
}else
if(($iext=strtolower(strrchr($upfile_name,'.')))&&!strcasecmp($iext,".dxf"))
{$fname=explode(".",$upfile_name);$fname=urlencode($fname[0]);
//if(file_exists("tmp/".$fname.$iext))$fname=uniqid("");
if(!@copy($upfile,"./tmp/".$fname.$iext))
{if($fdcontents=@file_get_contents($upfile_name))
{if($fd=fopen("tmp/".$fname.$iext,"wb"))
{fwrite($fd,$fdcontents);fclose($fd);$fdtrue=1;
}else echo("upload failed: ".$upfile_name."
\ncouldn't write: tmp/".$fname.$iext."
");
}else echo("upload failed:: ".$upfile_name.":".$fname.$iext."
");
}else $fdtrue=1;
}
else {prompt("error: that's not a dxf file
:$upfile_name:");exit(1);}
if($fdtrue) // just uploaded, set stat vars for original
{$loaded=true;$aspect=1;}
?>