diff options
author | Sashi20 | 2020-02-03 14:52:22 +0530 |
---|---|---|
committer | GitHub | 2020-02-03 14:52:22 +0530 |
commit | c7fc26b4749ddc5e8fa79abe35a0a8b84fd26c4a (patch) | |
tree | 97cef0c9e7fcfa6dac67639b4598483b7270985d /download.inc | |
parent | 0ad25d346f2e487049810cc3e796cde90d831234 (diff) | |
parent | ea8664a466b084a09e286aa4200c447b458e6510 (diff) | |
download | dwsim_custom_model-c7fc26b4749ddc5e8fa79abe35a0a8b84fd26c4a.tar.gz dwsim_custom_model-c7fc26b4749ddc5e8fa79abe35a0a8b84fd26c4a.tar.bz2 dwsim_custom_model-c7fc26b4749ddc5e8fa79abe35a0a8b84fd26c4a.zip |
Merge pull request #4 from Sashi20/master
Add form to submit ideas for custom model
Diffstat (limited to 'download.inc')
-rwxr-xr-x | download.inc | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/download.inc b/download.inc index 10e4eee..e81d822 100755 --- a/download.inc +++ b/download.inc @@ -11,7 +11,6 @@ function custom_model_download_uploaded_file() $result = $query->execute(); $custom_model_uploaded_file = $result->fetchObject(); $samplecodename = $custom_model_uploaded_file->samplefilepath; - //var_dump($root_path . $custom_model_uploaded_file->directory_name . '/' . $samplecodename);die; ob_clean(); header("Pragma: public"); header("Expires: 0"); @@ -62,4 +61,33 @@ function custom_model_project_files() { readfile($root_path . $directory_name . $samplecodename); //ob_end_flush(); //ob_clean(); +} +function custom_model_download_idea_reference_file() +{ + $proposal_id = arg(3); + $root_path = custom_model_ideas_files_path(); + $query = db_select('custom_model_idea_proposal'); + $query->fields('custom_model_idea_proposal'); + $query->condition('id', $proposal_id); + $query->range(0, 1); + $result = $query->execute(); + $uploaded_idea_reference_file = $result->fetchObject(); + $samplecodename = $uploaded_idea_reference_file->reference_file; + //var_dump($root_path . $custom_model_uploaded_file->directory_name . '/' . $samplecodename);die; + 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/zip'); + header('Content-disposition: attachment; filename="' . $samplecodename . '"'); + header('Content-Length: ' . filesize($root_path . $uploaded_idea_reference_file->directory_name . '/' . $samplecodename)); + header("Content-Transfer-Encoding: binary"); + header('Expires: 0'); + header('Pragma: no-cache'); + ob_clean(); + readfile($root_path . $uploaded_idea_reference_file->directory_name . '/' . $samplecodename); + //ob_end_flush(); + //flush(); }
\ No newline at end of file |