entity; $socId = (int) GETPOST('soc_id', 'int'); // Security check if (empty($modulepart)) { httponly_accessforbidden('Bad link. Bad value for parameter modulepart', 400); } if (empty($original_file)) { httponly_accessforbidden('Bad link. Missing identification to find file (original_file)', 400); } // get original file $ecmfile = ''; // Define attachment (attachment=true to force choice popup 'open'/'save as') $attachment = true; if (preg_match('/\.(html|htm)$/i', $original_file)) { $attachment = false; } if (isset($_GET["attachment"])) { $attachment = GETPOST("attachment", 'alpha') ? true : false; } if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) { $attachment = false; } // Define mime type if (GETPOST('type', 'alpha')) { $type = GETPOST('type', 'alpha'); } else { $type = dol_mimetype($original_file); } // Security: Force to octet-stream if file is a dangerous file. For example when it is a .noexe file // We do not force if file is a javascript to be able to get js from website module with