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

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

别再吹冷风 发布于 2021-11-24 字数 1701 浏览 822 回复 1

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:wwwxxxappthird_partyhproseHproseClient.php

Line Number: 165

Backtrace:

File: E:wwwxxxappthird_partyhproseHproseClient.php
Line: 185
Function: doInput

File: E:wwwxxxappthird_partyhproseHproseClient.php
Line: 40
Function: invoke

File: E:wwwxxxappmodelsUser_model.php
Line: 83
Function: __call

File: E:wwwxxxappmodelsUser_model.php
Line: 83
Function: run

File: E:wwwxxxappcontrollersUser.php
Line: 61
Function: upload

File: E:wwwxxxindex.php
Line: 292
Function: require_once

hprose 1.5.5

apache版本:2.4.10

php版本5.6.3

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷清清 2021-11-25 1 楼

我找到原因了,是我程序寫法錯誤,真得很不好意思...