diff options
author | Sashi20 | 2020-02-11 15:05:18 +0530 |
---|---|---|
committer | Sashi20 | 2020-02-11 15:05:18 +0530 |
commit | 2c9dd81a51984958591f5eb6a2d86fc3803794f2 (patch) | |
tree | 46f578cf69cb531e266a0920743b30c218f65343 /download.inc | |
parent | 355471fdcdd28f4f689a6dc736ed8f6d0b945a92 (diff) | |
download | dwsim_flowsheet-2c9dd81a51984958591f5eb6a2d86fc3803794f2.tar.gz dwsim_flowsheet-2c9dd81a51984958591f5eb6a2d86fc3803794f2.tar.bz2 dwsim_flowsheet-2c9dd81a51984958591f5eb6a2d86fc3803794f2.zip |
Add link to download abstract
Diffstat (limited to 'download.inc')
-rwxr-xr-x | download.inc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/download.inc b/download.inc index 5b54648..5dfb9ef 100755 --- a/download.inc +++ b/download.inc @@ -17,6 +17,41 @@ function dwsim_flowsheet_download_user_defined_compound() ob_clean(); readfile($root_path . $dwsim_flowsheet_user_compund_data->directory_name . '/' . $dwsim_flowsheet_user_compund_data->user_defined_compound_filepath); } +function dwsim_flowsheet_download_abstract() { + $proposal_id = arg(3); + $root_path = dwsim_flowsheet_path(); + //var_dump($proposal_id);die; + $query = db_select('dwsim_flowsheet_submitted_abstracts_file'); + $query->fields('dwsim_flowsheet_submitted_abstracts_file'); + $query->condition('proposal_id', $proposal_id); + $query->condition('filetype', A); + $result = $query->execute(); + $flowsheet_project_files = $result->fetchObject(); + //var_dump($custom_model_project_files);die; + $query1 = db_select('dwsim_flowsheet_proposal'); + $query1->fields('dwsim_flowsheet_proposal'); + $query1->condition('id', $proposal_id); + $result1 = $query1->execute(); + $flowsheet = $result1->fetchObject(); + $directory_name = $flowsheet->directory_name; + $samplecodename = $flowsheet_project_files->filename; + ob_clean(); + header("Pragma: public"); + header("Expires: 0"); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); + header("Cache-Control: public"); + header("Content-Description: File Transfer"); + header("Content-Type: application/pdf"); + header('Content-disposition: attachment; filename="' . $samplecodename . '"'); + header("Content-Length: " . filesize($root_path . $directory_name . $samplecodename)); + header("Content-Transfer-Encoding: binary"); + header("Expires: 0"); + header("Pragma: no-cache"); + ob_clean(); + readfile($root_path . $directory_name . '/' . $samplecodename); + //ob_end_flush(); + //ob_clean(); +} function dwsim_flowsheet_download_solution_file() { $solution_file_id = arg(3); |