Bonjour,
Je pense avoir un problème au niveau du réencodage de mes pieces-jointes. Car j'arrive a faire un lien pour la télécharger, j'ai bien une pop-up voulez vous : ouvri enregistrer ... avec le nom de la piece-jointe ainsi que son extention jpeg,text...etc mais une fois téléchargée je n'est aucuns apercu (pour une image.jpeg)...Mon image.jpeg n'est pas vide, je l'ouvre avec bloc note et j'ai tout plein de caractère, ce qui me semble tout a fait normal. Voici le bout de mon code :
Voila j'espere que quelq'un a une idée...
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 $mbox = open_mailbox($mail_pop_server, $mail_login, $mail_pass); $structure = imap_fetchstructure($mbox,$msgid); # piece jointe # $return_content = imap_fetchbody($mbox,$msgid, $partnumber+1); $anencode = $structure->parts[$partnumber]->encoding; $atype = $structure->parts[$partnumber]->type; if($atype == "") $atype = 0; // Text $asubtype = $structure->parts[$partnumber]->subtype; if($asubtype == "") $asubtype = 'PLAIN'; $attach_type = $mimetype[$atype]."/".$asubtype; if($anencode == 1) $return_content = imap_8bit($return_content); if($anencode == 2) $return_content = imap_binary($return_content); if($anencode == 3) $return_content = imap_base64($return_content); if($anencode == 4) $return_content = imap_qprint($return_content); $nom_fichier = $structure->parts[$partnumber]->parameters[0]->value; close_mailbox($mbox); header("Content-type: $attach_type"); header("Content-Disposition: attachment; filename = $nom_fichier" ); echo $return_content;
Pymouse
Partager