dengwei1999_个人页

个人头像照片 dengwei1999
0
4
0

个人介绍

暂无个人介绍

擅长的技术

获得更多能力
通用技术能力:

暂时未有相关通用技术能力~

云产品技术能力:

暂时未有相关云产品技术能力~

阿里云技能认证

详细说明
  • 提交了问题 2014-08-05

    PHP上传图片OSS同步更新

暂无更多信息
正在加载, 请稍后...
暂无更多信息
  • 提交了问题 2014-08-05

    PHP上传图片OSS同步更新

  • 回答了问题 2014-08-05

    PHP上传图片OSS同步更新

    RePHP上传图片OSS同步更新 下面附上我的代码,PHP用的是Thinkphp3.2的框架 public function add(){         if(IS_POST){             $oss_sdk_service = new \ALIOSS();             //设置是否打开curl调试模式             $oss_sdk_service->set_debug_mode(true);             $news_mod = D('News');             $data ['title'] =  I('post.title','','htmlspecialchars');             $data['ord'] = 0;             $data['addtime'] = time();             $data['status'] = 0;             if (isset($_FILES['pic'])){                 //文件上传配置,可以生成缩略图                 $date11 =date('Ymd');                 $upload = new \Think\UploadFile();// 实例化上传类                 $upload->maxSize  = 80000000 ;// 设置附件上传大小                 $upload->allowExts  = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型                 $upload->allowTypes = array('image/jpg','image/jpeg','image/pjpeg','image/png','image/gif');                 $upload->savePath =  './Upload/news/'.$date11.'/';// 设置附件上传目录                 $upload->saveRule = 'uniqid';                 //缩略图配置                 $upload->thumb = true;                 $upload->thumbMaxWidth = '300';                 $upload->thumbMaxHeight = '380';                 $upload->thumbPrefix = '';                 $upload->thumbSuffix ='.300';                 $upload->thumbRemoveOrigin = false;                 //开始上传                 if($upload->upload()){                     $info =  $upload->getUploadFileInfo();                     //大图                     $data['picurl'] =  '/Upload/news/'.$date11.'/'.$info[0]['savename'];                     //上传到OSS                     $picurl ='./Upload/news/'.$date11.'/'.$info[0]['savename'];                     //缩略图                     $thumbpic = getThumb($picurl,6);                     $thumbfilename = end ( explode ( '/', $thumbpic ) );;                     upload_by_file($oss_sdk_service,'Upload/news/'.$date11.'/'.$info[0]['savename'], $picurl);                     upload_by_file($oss_sdk_service,'Upload/news/'.$date11.'/'.$thumbfilename, $thumbpic);                 }             }             $result = $news_mod->add($data);             if(false !== $result){                 $this->success ( '新增成功!',  U('Home/Index/add') );             }             else{                 $this->error ( '新增巡失败!' );             }         }else{             $this->display();         }     } html代码               上传图片                 标题:                        上传图片:                                         ------------------------- RePHP上传图片OSS同步更新 //获取图片的缩略图名称 function getThumb($image,$lx) {     $filename = end ( explode ( '/', $image ) );     $filename1=explode('.',$filename);     if ($filename1) {         if($lx==1){             $lxtt = '.120.';         }else if($lx==2){             $lxtt = '.150.';         }else if($lx==3){             $lxtt = '.180.';         }else if($lx==4){             $lxtt = '.200.';         }else if($lx==5){             $lxtt = '.280.';         }else if($lx==6){             $lxtt = '.300.';         }         $files = $filename1[0].$lxtt.$filename1[1];         $newfile=str_replace($filename,$files,$image);         return $newfile;     } } ------------------------- RePHP上传图片OSS同步更新 希望这个帖子能加金啊 ------------------------- RePHP上传图片OSS同步更新 加个函数upload_by_file() //通过路径上传文件 function upload_by_file($obj,$object,$file_path){     $bucket = 'dengwei1999';    // $object = '115001_1313.jpg';    // $file_path = '../pic/115001_1313.jpg';     $response = $obj->upload_file_by_file($bucket,$object,$file_path);    // _format($response); }
    踩0 评论0
  • 回答了问题 2014-08-05

    PHP可以实现上传的文件先到本地服务器,然后再上传到OSS吗

    RePHP可以实现上传的文件先到本地服务器,然后再上传到OSS吗 刚做了个效果,可以实现PHP上传图片,本地服务器保留一份,OSS上同步更新 ------------------------- RePHP可以实现上传的文件先到本地服务器,然后再上传到OSS吗 可以的,我已经实现了,请看我的帖子 http://bbs.aliyun.com/read/166549.html?spm=5176.7189909.0.0.V7MY6s
    踩0 评论0
  • 回答了问题 2014-04-10

    ACE怎么设置pathinfo模式

    ReACE怎么设置pathinfo模式 我也有这种情况,我在网上找了好多帖子,按照这个设置都不成功 location / {             if (!-e $request_filename) {         rewrite  ^/(.*)$  /index.php/$1  last;                 break;         } } location ~ \.php {     fastcgi_pass 127.0.0.1:9000;     fastcgi_index index.php;     include fcgi.conf;     set $real_script_name $fastcgi_script_name;     if ($fastcgi_script_name ~ '^(.+?\.php)(/.+)$') {         set $real_script_name $1;         set $path_info $2;     }     fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;     fastcgi_param SCRIPT_NAME $real_script_name;     fastcgi_param PATH_INFO $path_info; }
    踩0 评论0
正在加载, 请稍后...
滑动查看更多
正在加载, 请稍后...
暂无更多信息