$file_dir = "your dir"; //用你的上传目录代替
$tmep_cfile1 = "goods_file".$i;
$temp_cf = "goods_file".$i;
$temp_cn = "goods_file".$i."_name";
$temp_cs = "goods_file".$i."_size";
$temp_ct = "goods_file".$i."_type";
$temp_cx = "goods_file".$i."_text";
$temp_cd = "goods_file".$i."_del";
if($_FILES[$tmep_cfile1]) {
$$temp_cf = $_FILES[$tmep_cfile1][tmp_name];
$$temp_cn = $_FILES[$tmep_cfile1][name];
$$temp_cs = $_FILES[$tmep_cfile1][size];
$$temp_ct = $_FILES[$tmep_cfile1][type];
}
if($$temp_cs > 0) {
if($$temp_cx) {
file_unlink(".{$$temp_cx}");
}
$$temp_cf = upload_file($$temp_cf, $$temp_cn, $$temp_cs, $file_dir, $g_file_okext, $g_max_file_size);
}
elseif($$temp_cd) {
if($$temp_cx) {
file_unlink(".{$$temp_cx}");
}
$$temp_cx = "";
}
写入数据库就是把那些文件名,路径,大小,类型之类的写入吧。没什么可说的了。
作者: 大宝
发布时间: 2008-03-02