我认为有几个输入字段是这样的
<head>
<title>Upload Form</title>
</head>
<body>
<?php echo form_open_multipart('info/normal_upload');?>
<input type="file" name="one" size="20" />
<input type="file" name="two" size="30" />
<input type="file" name="three" size="40" />
<br /><br />
<input type="submit" value="upload" />
</form>
</body>
</html>
我正在像这样上传文件
$config['upload_path'] = realpath(FCPATH.'uploads');
$config['allowed_types']= "gif|jpg|png|jpeg|pdf";
$config['overwrite'] = TRUE;
$config['max_size'] = "2048000";
$config['max_height'] = "5000";
$config['max_width'] = "5000";
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('one'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('normal_upload', $error);
}
if ( ! $this->upload->do_upload('two'))
{
$error = array('error' => $this->upload->display_errors());
//$this->load->view('normal_upload', $error);
}
if ( ! $this->upload->do_upload('three'))
{
$error = array('error' => $this->upload->display_errors());
//$this->load->view('normal_upload', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
echo $data['upload_data']['full_path'].'<br/>';
//$this->load->view('normal_upload', $data);
}
我想获取所有上传文件的文件名、路径。如果我在所有表单字段中选择文件,文件将被上传,但是:
echo $data['upload_data']['full_path'].'<br/>';
只能获取一个文件路径。如何获取文件路径并重命名上传的文件?
慕虎7371278
忽然笑