IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

jQuery Discussion :

plugin Uploadify, problem encode json (je suppose)


Sujet :

jQuery

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2008
    Messages
    64
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2008
    Messages : 64
    Points : 49
    Points
    49
    Par défaut plugin Uploadify, problem encode json (je suppose)
    Bonjour voici mon problème :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    $("#produit_image").uploadify({
    		'uploader'       : 'javascripts/uploadify.swf',
    		'script'         : 'uploadify.php',
    		'cancelImg'      : 'images/cancel.png',
    		'folder'         : '../upload/images',
    		'auto'           : true,
    		'multi'          : false,
    		'method'         : 'POST',
    		'sizeLimit'		 : 200000000,
    		'fileDesc'       : true,
    		'fileExt'           : '*.jpg;*.jpeg',
    		 onError: function (event, queueID ,fileObj, errorObj) {
                            var msg;
                            if (errorObj.status == 404) {
                                    alert('Le script d upload n a pas été trouvé');
                                    msg = 'Le script d upload n a pas été trouvé.';
                            } 
    						else if (errorObj.type === "HTTP")
                                    msg = errorObj.type+": "+errorObj.status;
                            else if (errorObj.type ==="File Size")
                                    msg = "Le poids de l'image envoyée doit-être inférieur à 2 Mo";						
                            else{
    							msg = errorObj.type+": "+errorObj.text;                   
    							hasAttach = false;
    							return false;
    						}
    						$('.flash').html('<div class="message error"><p>'+ msg +'</p></div>'); 
                    },
    				onCancel: function (a, b, c, d) {
                            var msg = "Envoi image annulé";
                            $('.flash').html('<div class="message error"><p>'+ msg +'</p></div>'); 
                            hasAttach = false;
                    },
                    onClearQueue: function (a, b) {
                            var msg = "Cleared "+b.fileCount+" files from queue";
                            $('.flash').html('<div class="message error"><p>'+ msg +'</p></div>'); 
                            hasAttach = false;
                    },
                    onComplete: function (a, b, c, d, e) {
                            var size = Math.round(c.size/1024);
    						var msg = "Envoi image réussi";
    						reponse =  d;
                           $('.flash').html('<div class="message notice"><p>'+ msg + reponse +'</p></div>');					   
    					   $('#image').html('<?php echo $_GET['id']; ?>.jpg');
    					   $('#nom_image').val('<?php echo $_GET['id']; ?>.jpg');
    				} 
    	});
    });
    Au niveau de response. Je devrais avoir la valeur "ok" or j'ai un truc encrypté du genre :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    ÿØÿàjÿ넊U*Ğíþ}êï‹õg¶·±³‘ w¶Æȃù׭C0‚ÃGßï)ÅÁ~ä®yu0ÓöîŠ^욗ù›ºdþ‹û?Ê2¨rò2y&§´‚òãMž×Xh$-² £üE`iwö:Ž„º]åÀ·‘0‰ÇN„éQÜZèzu”žuÏÛg?p,„è'ù×t3(Æ”5‚…šr²ÛTãgvsK.iF_ú+¿¾ëCNÞ_ìo-Ì ¾sàî#¹?ÐVt&YtùmuHZà¾@dµ¾âlŠ2*,ûёë^5ŽÎR2*,ûŠ3ïEƒ”—"ŒŠ‹põdzŠ,¤¹£"¢ÝïˆüSk¦·ƒ]Ô•>§úW¡–e8¼ҺÃá å'øy·²^là̳,&YA×ÅMF+ñòK«:RÀd“ŒUxõ).>ÏÔO/÷²JóH®5Ÿjٮ«rÀpˆ¾¸è 6™i¥[-“Ÿãs÷œû×ÑgÜ/‡È)(bësW’¿$‘]å'ù[_Äù쏈ëçµ´yhE۞[·Ú1_ôü MßZ2=ê,ûёë_cì9Ir(È÷¨³ïF}ÅRz2*,ûѸzÑ`å%ȣ5}èϽSWÂgþ++ýé?ô^°:W™|8±’÷ÄM¨þe nÍ+côüëÓGJý;…)Jžò[¶צ‡Éç’O¢º/ó¨´QE})ã KIEÚHÎ? lÓ,Q—98ì:Ÿj}ùƭ¨ÿñy¨à>Zãõ—üX:¼·õóµiE;y~'2“œ’}ßàìŒïøËGð´j)3¹Xã‰71ÇSנ«ñ^…âko;H¾Žb¿~3òȟU<׌þÔO ñŽ >_Ù¯×?Ҽ«JÔïtËØï4û©m®#9Y#l_Q‚áêX¼j©57÷n|vaÅU°9ŒèÊ ÓVõÛ{Ÿk‚ -xçïŒv—Â=?Äå-.xU»QˆŸýïîŸ~ŸJõøeIcWÕцU”äê |î3[>J±·äý¬Àf8|}?iBWòê½Q%Q\‡p”´”´UÊÊÕpnôÅíY@šԯ=«$ÏRnRO§ùIKEI¡“y¶ڤW±FÒG(Ϊ2G?+~ ûjK#ö]fêÔð—s ÃxºÚÔ÷žÿ*Ž€WÊqj¡†¦õ{ù.ß?Èû>ɜæ±UV‹o7ßÑ~døâ”RÑ_}ð”´Q@%-G·ÈùXÉM/ï]NJþxßBwuÓR¶%²ýæGºýáùWu ʹ†;˜%ÁÁY©¯«£Š¥]sS’~‡ÈÖÀÖÃ˖¬õC‹ÒªåèRÌ~UcôµÌU2büÒ,ØѼ*Ë|ƒ߭LF0£ŸZÜVÀ  É婎ôŽõµà^øÃÄÐhöyPÙy¥ÆDH9,—ԊŠµcJrvHº4'ZjWl£gÄ ÷cšÖÒ_1Ⱦ„̕]*`{Å[Ò:ú*k£G›‰‹qf¶}èÍGš3E2Āš‹ÍW(Tô~A¥ÍF ª¶h±qH³º²5ÍÛû`Vžkí·\ÈÚ4ֆØhû̯}Ìaý VG*Om_Y²ҔnçHrq¹€Ïᚫâ½÷Ã^"¼ÑoЬÖÒÎ8uþÄsYJ¬=§%õµþGµJ„Ý{h®SuÜ2½C¿ *=žȒx>µD*7#J˜öò¯*7jŒ–_¼¤}E)E=‹!éÁýê qëVl*/oeYÚ\\ÈÝ(ÙÉü'$· I·d‰•$eäuDRÌÇð&à«#J¶-;ß]K̲ýOaì8®«¥|.oKûºzCó?Cɲ(à¿ySYþGÇß 4vÐþ"ê¶ávÃ<Ÿi‡Ý_ŸÐä~Ëi²bí=ò+ß?j}ôkÆñ¬öÒ}ž@XèÙ#¸?Ì×Ï IåʯŸºs_a“⾳„„žëGò>>Àý[Rgªùê3Q«‚2)s^¹ò\£÷STüïøSsH„ã>§4 - wV—cêk^êO*ÝܞƒŠÁš–va!£g¤þÏ:Kj¿m&eÝ ‚=Ãý@Âþ¤~UìþEãM-otð‘kV©ˆ\ð&N¾[{*fþÌ~}3ÂSk—•ŸTpS#‘d/æI?•zñêR=”JK•¤ÎmÉÿ
    Voici mon script php :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    if (!empty($_FILES)) {
    	$tempFile = $_FILES['Filedata']['tmp_name'];
    	$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
     
    	/*
    	$auv = array('/','..');
    	$aup = array('','');
    	$toto = str_replace($auv, $aup, $_REQUEST['folder']);
     
    	$fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
    	if(($fileTypes=="jpg") || ($fileTypes=="jpeg")){	
     
    	*/
    	if($_FILES['Filedata']['type']='image/jpeg'){
     
     
    	//*************************
    	// Création de vignettes 
    	//*************************
     
    	// Définir les paramètres
    	$oldname = $_FILES['Filedata']['tmp_name'];
    	$normal = $id.".jpg";
    	$vignette = $id."_tn.jpg";
    	$newh = 256;
     
     
    	$targetNormal =  str_replace('//','/',$targetPath) . $normal;
    	$targetVignette =  str_replace('//','/',$targetPath) . $vignette;
     
    	// Interpoler les dimensions
    	$size = getImageSize($oldname);
    	$w = $size[0];
    	$h = $size[1];
    	$neww = intval($newh * $w / $h);
     
    	// Recréer une image de taille inférieure
    	$resimage = imagecreatefromjpeg($oldname); 
    	$newimage = imagecreatetruecolor($neww, $newh);  
    	imageCopyResampled($newimage, $resimage,0,0,0,0,$neww, $newh, $w, $h);
     
    	//Sauvegarder la nouvelle image
    	imageJpeg($newimage, $newname, 85);
     
     
    	// $fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
    	// $fileTypes  = str_replace(';','|',$fileTypes);
    	// $typesArray = split('\|',$fileTypes);
    	// $fileParts  = pathinfo($_FILES['Filedata']['name']);
     
    	// if (in_array($fileParts['extension'],$typesArray)) {
    		// Uncomment the following line if you want to make the directory if it doesn't exist
    		// mkdir(str_replace('//','/',$targetPath), 0755, true);
     
    		move_uploaded_file($tempFile,$targetVignette);
    		move_uploaded_file($tempFile,$targetNormal);
    	}else{
    		$nomfichier= replace($_FILES['Filedata']['name']);
    		$targetFile =  str_replace('//','/',$targetPath) . $nomfichier;
    		move_uploaded_file($tempFile,$targetFile);		
    	}
     
     
    		echo "ok";
    	// } else {
    	// 	echo 'Invalid file type.';
    	// }
    }
    ?>
    Estce que quelqu'un pourrait m'aider à decripter cette variable reponse ?

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2008
    Messages
    64
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2008
    Messages : 64
    Points : 49
    Points
    49
    Par défaut
    c'était une erreur dans uploadify.php !!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [Plugin][Lomboz]probleme d'installation de lomboz
    Par tic42 dans le forum Eclipse Java
    Réponses: 8
    Dernier message: 13/07/2005, 12h35
  2. [ plugin ][ TomCat ] probleme au démarrage de tomcat
    Par winnet dans le forum Eclipse Java
    Réponses: 3
    Dernier message: 20/06/2005, 16h12
  3. [Plugin][MyEclipse]Probleme MyEclipse,Tomcat et java 1.5
    Par dguenard dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 13/06/2005, 12h15
  4. [Plugin][EasyStruts]probleme EasyStruts eclipse2.1.3
    Par furikuri dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 11/02/2005, 19h10
  5. [Plugin][easystruts]Probleme avec eclipse struts et tomcat
    Par chng001 dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 09/10/2004, 09h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo