
已解决问题
谷歌鍩庡崡缃戜簨用户在2016.04.21提交了关于“西班牙紧急在php中使用jquery uploadify进行多图片上传”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2025-02-23T02:55:50。希望大家能够帮助她。详细问题描述及疑问:期待您的答案,感谢你,我会记得你对我的好的 !
详细问题描述及疑问:期待您的答案,感谢你,我会记得你对我的好的 !
jquery
本文是以
1.增加**表dili_fieldtypes新字段
2.
1case'i
2$fiel
3'type'=>'
5'default'=>''
6);
7bre**;
3.
1function
3//$w
4//$heigh
5return;
4.在content_form.php和category_cont
01
02i
03?>
04
05
06
07上传
09
10"value=""/>
11"va
12asset/
13
14
6.
01
02if(!defined('BA**PATh**'))exit('Nodirectsc
03date_default_timezo
04classPhotoextendsFront
05publi
06{
07parent::__co
08}
09function_g
10{
11$path="att
12if(!file_exists($path)){
13mkdir($path,'777');
14}
15$path.=date("m")."/";
16if(!file_exists($path)){
17mkdir($path,'777');
18}
19return$path;
20}
21function_creat_photothumbs($FileName,$setW){
22$IMGInfo=getimagesize($FileName);
23if(!$IMGInfo)returnfalse;
24if($IMGInfo['mime']=="image/pjpeg"||$IMGInfo['mime']=="image/jpeg"){
25$ThisPhoto=imagecreatefromjpeg($FileName);
26}elseif($IMGInfo['mime']=="image/x-png"||$IMGInfo['mime']=="image/png"){
27$ThisPhoto=imagecreatefrompng($FileName);
28}elseif($IMGInfo['mime']=="image/gif"){
29$ThisPhoto=imagecreatefromgif($FileName);
30}
31$width=$IMGInfo['0'];
32$height=$IMGInfo['1'];
33$scale=$height/$width;
34$nw=$setW;
35$nh=$nw*$scale;
36$NewPhoto=imagecreatetruecolor($nw,$nh);
37imagecopyresampled($NewPhoto,$ThisPhoto,0,0,0,0,$nw,$nh,$width,$height);
38ImageJpeg($NewPhoto,$FileName);
39returntrue;
40}
41function_s**ephoto_post(){
42$dest_dir=$this->_getFilePath();
43if(!empty($_FILES)){
44$date=date('Ymd');
45//$dest_dir=$this->_getFilePath();
46$photoname=$_FILES["Filedata"]['name'];
47$phototype=$_FILES['Filedata']['type'];
48$photosize=$_FILES['Filedata']['size'];
49$fileInfo=pathinfo($photoname);
50$extension=$fileInfo['extension'];
51$newphotoname=date("Ymdh**is").mt_rand(10000,99999).'.'.$extension;
52$dest=$dest_dir.$newphotoname;
53//move_uploaded_file($_FILES['Filedata']['tmp_name'],iconv("UTF-8","gb2312",$dest));
54move_uploaded_file($_FILES['Filedata']['tmp_name'],$dest);
55//chmod($dest,0755);
56//如果宽度大于600则要进行裁剪
57$arr=getimagesize($dest);
58if($arr[0]>600){
59$thumb_w=600;
60$this->_creat_photothumbs($dest,$thumb_w);
61}
62//生成缩略图
63$config2['image_library']='gd2';
64$config2['source_image']=$dest;
65$config2['create_thumb']=TRUE;
66$config2['maintain_ratio']=TRUE;
67$config2['width']=170;
68$config2['height']=150;
69$config2['master_dim']="width";
70$config2['thumb_marker']="_1";
71$this->load->library('image_lib',$config2);
72$this->image_lib->resize();
73echo$dest;
74}
75}
76}
77?>
好了,可以测试了。