Check out the LimeSurvey source code on GitHub!

encoding problems with uploads

More
5 years 6 months ago #64686 by mattias01
I need to download files from the upload / surveys / files, but these are encoded, I have the following code to force a download

$f=$_GET;
$partes_ruta = pathinfo("/upload/surveys/46443/files/$f");
//echo $partes_ruta;
header('Content-Description: File Transfer');
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$f\"\n");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
$archivo= $f.".".$partes_ruta;
//$fp=fopen("$f", "r");
$fp=fopen($archivo, "r");
fpassthru($fp);




regards
Attachments:

Please Log in to join the conversation.

More
5 years 6 months ago #64689 by c_schmitz

Best regards

Carsten Schmitz
LimeSurvey project leader

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form