Le site des utilisateurs francophones de FluxBB.
Vous n'êtes pas identifié(e).
Pages : 1
Bonjour,
Je me tourne vers vous, suite à un léger soucis de la mod : Attachment, sur mon forum fluxbb. En effet, lorsque j'upload des fichiers, tout ce passe très bien, le fichier n'est pas corrompu. Par contre, lorsque nous téléchargeons un fichier, une fois sur deux, il est possible de ce retrouver avec un fichier faisant 0Mo.
J'ai contacté mon hébergeur, nous avons poussé les limite du POST PHP.Ini à à 100Mo, alors que mes fichiers ne font que grand maximum 60Mo. Je suis chez Easy-Hebergement, si jamais.
Je vous poste la portion de code qui permet de géré la parti de download :
// put the file out for download
// update number of downloads
$result = $db->query('UPDATE '.$db->prefix.'attach_2_files SET downloads=downloads+1 WHERE id='.$attach_item) or error('Unable to update downloads',__FILE__,__LINE__,$db->error());
$db->close(); // end db connection - needed for other than mysql db
// open a pointer to the file
$fp = fopen($pun_config['attach_basefolder'].$attach_location, "rb");
if(!$fp)
message($lang_common['Bad request']);
$attach_filename=rawurlencode($attach_filename); // fix filename (spaces may still mess things up, perhaps add a specific MSIE thing later, not sure though)
// send some headers
header('Content-Disposition: attachment; filename='.$attach_filename);
if(strlen($attach_mime)!=0)
header('Content-Type: ' . $attach_mime );
else
header('Content-type: application/octet-stream'); // a default mime is nothing is defined for the file
header('Pragma: no-cache'); //hmm, I suppose this might be possible to skip, to save some bw, but I'm far from sure, so I let the 'no cache stuff' be...
header('Expires: 0');
header('Connection: close'); // Thanks to Dexus for figuring out this header (on some systems there was a delay for 5-7s for downloading)
if($attach_size!=0)
header('Content-Length: '.$attach_size);
// and finally send the file, fpassthru might be replaced later, rumors say fpassthru use alot of memory...
fpassthru($fp);
exit;Je ne comprends vraiment plus rien.. Enfin je vous remercie d'avance pour votre aide précieuse.
Slam2
Hors ligne
Pages : 1