【发布时间】:2014-05-10 20:53:33
【问题描述】:
我在 html 中有这段代码
<input type="file" name="file" id="file1"/><br />
<input type="file" name="file" id="file2"/><br />
这是我的 php 代码
if(!empty($_FILES['image']['name'])) {
$ext=explode('.',$_FILES['image']['name']);
$new_name=$property_id."_".rand(10,10000).".".end($ext);
$name=SITEPATH.S_LOCATIONS_LARGE.$new_name;
$small=SITEPATH.S_LOCATIONS.$new_name;
move_uploaded_file($_FILES['image']['tmp_name'],$name);
if(is_file($name)) {
$this->db->update("insert into bloom_location_images (image,property_id) values ('$new_name',$property_id)");
list($width, $height, $type, $attr) = getimagesize($name);
if($width > 600) {
$this->magic->constrain_by_scale($name,500,0);
}
copy($name,$small);
if($width > 301) {
$this->magic->constrain_by_scale($small,301,0);
}
}
}
return $property_id
现在我想存储这两个文件,但我不能。我想我必须通过数组元素传递它。如果是,请告诉我怎么可能
please help me to do this
【问题讨论】:
标签: php