【发布时间】:2012-10-31 06:34:26
【问题描述】:
我正在使用codeIgniter 文件上传类示例https://www.codeigniter.com/user_guide/libraries/file_uploading.html 来上传文件。在我上传文件后的示例中,它将在上传成功视图页面中显示如下详细信息。
Array
(
[upload_data] => Array
(
[file_name] => VenkataKrishna10.pdf
[file_type] => application/pdf
[file_path] => C:/xampp/htdocs/upload/application/
[full_path] => C:/xampp/htdocs/upload/application/VenkataKrishna10.pdf
[raw_name] => VenkataKrishna10
[orig_name] => VenkataKrishna.pdf
[client_name] => VenkataKrishna.pdf
[file_ext] => .pdf
[file_size] => 83.27
[is_image] =>
[image_width] =>
[image_height] =>
[image_type] =>
[image_size_str] =>
)
)
之后我尝试以数组格式查看整个上传的数据。我的问题是如何从上面的数组中获取完整的文件路径。我知道有一个变量full_path,但我无法得到它。请帮帮我。
【问题讨论】:
-
你试过
$array['upload_data']['full_path']吗? -
我试过这个也给出错误 A PHP Error was seen 严重性:Notice Message: Undefined variable: array Filename: controllers/upload.php Line Number: 34
-
从控制器尝试
$data['upload_data']['full_path'],从视图中尝试$upload_data['full_path'] -
不,它给出了错误............说明没有索引
-
感谢air4x ........你可以写一个回答我会接受......
标签: php codeigniter