用户
 找回密码
 入住 CI 中国社区
搜索
查看: 7620|回复: 10
收起左侧

[上传/下载] 如何上传swf文件

[复制链接]
发表于 2010-4-23 11:50:36 | 显示全部楼层 |阅读模式
本帖最后由 langziyang 于 2010-5-12 15:16 编辑

$config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png|swf|flv|rar';
        $config['max_size'] = '0';
        $config['max_width']  = '0';
        $config['max_height']  = '0';


mimes文件本身带有'swf' => 'application/x-shockwave-flash',

rar文件也不行,swf文件也写上了,上传后提示:
The filetype you are attempting to upload is not allowed.

解决了,上传一个类,代替就行
Upload.rar (5.21 KB, 下载次数: 49)
发表于 2010-4-23 12:48:40 | 显示全部楼层
This is a BUG existing since 1.7.1. For the simple solution if you donnot want to touch the library of the UPLOAD class, please refer to the following link of my Blog:

http://www.cnsaturn.com/posts/a- ... lass-of-codeingiter

Sorry, I cannot type Chinese on this machine right now.
 楼主| 发表于 2010-4-23 12:56:49 | 显示全部楼层
我又在mimes文件里加了如下东西也不行
'swf'        =>        array('application/x-shockwave-flash','application/x-shockwave-flash2-preview','application/futuresplash','image/vnd.rn-realflash'),
 楼主| 发表于 2010-4-23 12:58:40 | 显示全部楼层
This is a BUG existing since 1.7.1. For the simple solution if you donnot want to touch the library  ...
saturn 发表于 2010-4-23 12:48



    放前面也不行
 楼主| 发表于 2010-4-23 13:36:13 | 显示全部楼层
解决了…………………………………………………………………………………………………………………………
发表于 2010-5-1 15:10:09 | 显示全部楼层
回复 5# langziyang


    怎么解决的????说说~~呵呵~~
发表于 2010-5-4 09:11:54 | 显示全部楼层
使用第三方swf上传文件。推荐swfupload。
发表于 2010-5-13 15:43:43 | 显示全部楼层
swfupload? is good?
发表于 2010-5-25 16:59:17 | 显示全部楼层
swfupload 也无法解决SESSION无法传递的问题
是这样吗?
发表于 2010-7-9 21:02:13 | 显示全部楼层
,今天我刚发了帖子,,
你可以这么处理
$config['allowed_types'] = 'gif|jpg|png|swf|flv|rar';
改成
$config['allowed_types'] = 'swf|flv|rar|gif|jpg|png|';

没错,所有图片类型置后。。。

本版积分规则