檔案傳輸出現An uncaught Exception was encountered錯誤

allenplay 发布于 2015/06/17 17:00
阅读 1K+
收藏 0

Dear andot

我透過hprose傳檔,程序碼如下,在client端出現An uncaught Exception was encountered的錯誤,但檔案卻有正確傳送至伺服端,詳細錯誤信息,請看第3段,請問是否我寫法上有問題?

client端

$_bin_file = new HproseBytesIO();
$_bin_file->load($_str_src_path);

$client->run('file', 'upload', [$filename, $_bin_file], $_arr_app);
server端

class HSfile{
	APIupload($_str_filename, $_bin_file)
	{
		$_str_path = "./upload/" . DATE('Y')."/";
		$_str_new_name = DATE('YmdHis');
		$_str_ext_name = end(explode('.', $_str_raw_name));
		
		if(!file_exists($_str_path)) mkdir($_str_path, 0777, TRUE);
		
		write_file($_str_path . $_str_new_name . "." . $_str_ext_name , $_bin_file);
		
		
	}
}
錯誤資訊

An uncaught Exception was encountered

Type: Exception

Message: Runtime Notice: Only variables should be passed by reference

Filename: E:\www\xxx\app\third_party\hprose\Hprose\Client.php

Line Number: 165

Backtrace:

File: E:\www\xxx\app\third_party\hprose\Hprose\Client.php
Line: 185
Function: doInput

File: E:\www\xxx\app\third_party\hprose\Hprose\Client.php
Line: 40
Function: invoke

File: E:\www\xxx\app\models\User_model.php
Line: 83
Function: __call

File: E:\www\xxx\app\models\User_model.php
Line: 83
Function: run

File: E:\www\xxx\app\controllers\User.php
Line: 61
Function: upload

File: E:\www\xxx\index.php
Line: 292
Function: require_once



hprose 1.5.5

apache版本:2.4.10

php版本5.6.3

加载中
0
a
allenplay
我找到原因了,是我程序寫法錯誤,真得很不好意思...
返回顶部
顶部