$fnpath="attachments/$uws_user/"; $fn="$fnpath$att"; $fd=fopen("$fn.encrypted","r"); if($fd) { $data=fread($fd,filesize($fn.".encrypted")); fclose($fd); $data=pem_decrypt(substr($att_type,4),$att_passwd,$data); $fd=fopen("$fn","w"); if($fd) { fwrite($fd,$data); fclose($fd); } else { $message="Couldn't open file for writing..."; } } else { $message="Couldn't open attachment for reading..."; } ?>
|