该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
本人比较菜,看不出来为什么,只支持office2003或者是office2007.请问如何能改为更高版本的吗,因为这两个版本只有32位的,在64位系统下调用不到COM组件。
/*********************/
/* */
/* Dezend for PHP5 */
/* NWS */
/* Nulled.WS */
/* */
/*********************/
$debug = true;
header( "Content-Type:text/xml;charset=UTF-8" );
header( "Cache-Control: no-store, no-cache, must-revalidate" );
header( "Cache-Control: post-check=0, pre-check=0", false );
require_once( "../inc/inc.php" );
$uploadFileName = $_FILES[*Filedata*][*name*];
$uploadFile = $_FILES[*Filedata*][*tmp_name*];
$localFormat = getFileExt( $uploadFileName );
$is_allowed_upload = true;
$forbbidenFileType = array( "php", "sh", "exe", "bat" );
putlog( "1: ".api_get_path( SYS_PATH ));
foreach ( $forbbidenFileType as $value )
{
if ( strtolower( $localFormat ) == $value )
{
$is_allowed_upload = false;
break;
break;
}
}
if ( strtolower( $localFormat ) != "ppt" )
{
$is_allowed_upload = false;
}
if ( $is_allowed_upload && is_uploaded_file( $uploadFile ) )
{
$extendType = getFileExt( $uploadFileName );
$localFileName = trim( $_GET[*fileName*] );
$localFile = api_get_path( SYS_PATH )."meeting/pptUpload/".$localFileName;
if ( move_uploaded_file( $uploadFile, $localFile ) )
{
$pos = strrpos( $localFileName, "." );
$len = strlen( $uploadFileName );
$folder = substr( $localFileName, 0, $pos );
$create_date = date( "Y-m-d h:i:s" );
if ( !( $ppt = new COM( "powerpoint.application" ) ) )
{
exit( "Unable to Open MSPowerPoint" );
}
putlog( "断点1 ".$localFile ." ..");
$ppt->Visible = true;
putlog( "断点2 " );
$ppt->Presentations->Open( realpath( $localFile ) );
putlog( "断点3 " );
$pptCount = $ppt->activePresentation->Slides->Count;
$export_folder = api_get_path( SYS_PATH )."meeting/pptUpload/".$folder;
if ( !file_exists( $export_folder ) )
{
mkdir( $export_folder, 511 );
}
$ppt->activePresentation->Export( $export_folder, "JPG", 640, 480 );
$ppt->Quit( );
$sql = "insert into attachment (file_name,local_file_name,meet_no,file_size,file_type,created_time,model_type) values (*".$uploadFileName."*,*".$folder."*,*". trim( $_GET[*roomID*] )."*,*".$pptCount."*,*".$extendType."*,NOW(),*PRESENTATION*)";
$rs = api_sql_query( $sql, __FILE__, 61 );
if ( !$rs && $debug )
{ putlog("insert zlchat pptFile -".$uploadFileName." ERROR!");
error_log( "insert zlchat pptFile -".$uploadFileName." ERROR!", 0 );
}else
putlog($sql);
$path2 = api_get_path( SYS_PATH )."meeting/pptUpload/".$folder."/";
$handle = opendir( $path2 );
while ( $file = readdir( $handle ) )
{
if ( !is_dir( $file ) )
{
preg_match_all( "/(\\d+)\\.JPG$/", $file, $name_arr );
$newName = $name_arr[0][0];
rename( $path2.$file, $path2.$newName );
}
}
closedir( $handle );
}
else
{
if ( $debug )
{
error_log( "upload zlchat pptFile -".$uploadFileName." ERROR!", 0 );
}
}
}
?>