wyu518 发表于 2008-11-21 22:37:50

图片上传问题

当我选择图片为“.jpg”文件时,老是提示 “The filetype you are attempting to upload is not allowed.”
选“.gif”文件时,能正常上传成功

$config['upload_path'] = './uploads/';
                  $config['file_name']         = $filename;
                  $config['allowed_types'] = 'gif|jpg|png|jpeg|JPG';
                  $config['max_size'] = '1024';
                  $config['max_width']= '1024';
                  $config['max_height']= '768';



问题二:CI能不能一次提交上传多张图片?怎么实现啊?

[ 本帖最后由 wyu518 于 2008-11-21 22:39 编辑 ]

wyu518 发表于 2008-11-21 22:40:42

<?php echo form_open_multipart('admin/savePic');?>
             <input type="file" name="userfile" size="20" /><br />
            <INPUT class="submit" type=submit value="提 交">
      <BR>
</FORM>

Hex 发表于 2008-11-21 23:24:55

提交多个图片,你需要有多个文件域。
然后每个文件域用一个 upload 方法就可以了。
不知道我这么说楼主明白吗?
<input type="file" name="userfile1" size="20" />
<input type="file" name="userfile2" size="20" />
<input type="file" name="userfile3" size="20" />

Hex 发表于 2008-11-21 23:25:35

文件类型不允许的问题请看 http://codeigniter.org.cn/forums/thread-442-1-1.html

hzysoft 发表于 2008-11-25 17:39:09

原帖由 Hex 于 2008-11-21 23:24 发表 http://codeigniter.org.cn/forums/images/common/back.gif
提交多个图片,你需要有多个文件域。
然后每个文件域用一个 upload 方法就可以了。
不知道我这么说楼主明白吗?




我明白了,哈哈哈
页: [1]
查看完整版本: 图片上传问题