|
public function swfupload_up()
{
//文件目录
$this->config->load('custom',TRUE);
$custom = $this->config->item('custom');
$file_forder =$custom['file']['upload_path'];;
$config['upload_path'] = $file_forder;
(!is_dir($config['upload_path']))&&@mkdir($config['upload_path'],0777,true); //文件目录
//文件保存路径 这儿我用的是实际路径
$config['allowed_types'] = $custom['file']['upload_file_type']; //允许上传格式
$config['max_size'] = $custom['file']['upload_file_size']; //允许上传大小
$config['max_width'] = $custom['file']['upload_image_size_h'];
$config['max_height'] = $custom['file']['upload_image_size_w'];
$config['file_name'] = $custom['file']['file_name']; //存放的文件名
$this->load->library('upload', $config);
$field_name = 'Filedata'; //上传表单字段名
if ($this->upload->do_upload($field_name))
{
$data = $this->upload->data();
$source =FCPATH.$file_forder.$data['file_name'];
$samll=$custom['file_small'];//创建小图
creat_small_img($source,$samll);
$img = $file_forder.$data['file_name']; //返回给SWF AND JQUERY显示的IMAGE地址
exit ('FILEID:'.$img);
}
else
{
//上传失败返回error图片
$img = base_url().'assets/img/error.jpg'; //返回给SWF AND JQUERY显示的IMAGE地址
exit ('FILEID:'.$img);
}
我上传的时候就收到 来自网页的提示 ---------------------------
来自网页的消息
---------------------------
FILEID:data/attachments/productlist/2012/09/22/201209221033314036.jpg
---------------------------
确定
---------------------------
, 但是图片 是已经上传了 |
|