summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202019-06-11 15:33:58 +0530
committerSashi202019-06-11 15:33:58 +0530
commit1235e78dac2bbd96b024451f43ce109dd930b2f2 (patch)
tree1a3c860ac757c35bf6fd1ae5fb7f3c64d48c8193
parent497867178a2cc300795fe470246d096a641d3025 (diff)
downloadom_flowsheet-1235e78dac2bbd96b024451f43ce109dd930b2f2.tar.gz
om_flowsheet-1235e78dac2bbd96b024451f43ce109dd930b2f2.tar.bz2
om_flowsheet-1235e78dac2bbd96b024451f43ce109dd930b2f2.zip
Rearrange headers to download file
-rwxr-xr-xabstract_bulk_approval.inc2
-rwxr-xr-xfull_download.inc14
-rwxr-xr-xupload_code.inc2
3 files changed, 12 insertions, 6 deletions
diff --git a/abstract_bulk_approval.inc b/abstract_bulk_approval.inc
index efcf6d3..77ef365 100755
--- a/abstract_bulk_approval.inc
+++ b/abstract_bulk_approval.inc
@@ -494,7 +494,7 @@ function _flowsheet_details($flowsheet_proposal_id)
$return_html .= '<strong>Name of compound for which process development is carried out:</strong><br />' . $prodata;
$return_html .= '<strong>Uploaded an abstract (brief outline) of the project:</strong><br />' . $abstract_filename . '<br /><br />';
$return_html .= '<strong>Upload the OpenModelica flowsheet for the developed process:</strong><br />' . $abstracts_query_process_filename . '<br /><br />';
- $return_html .= '<strong>Upload the OpenModelica flowsheet for the simulator package:</strong><br />' . $simulator_version_used . '<br /><br />';
+ $return_html .= '<strong>Simulator version used for creating the flowsheet:</strong><br />' . $simulator_version_used . '<br /><br />';
$return_html .= $download_flowsheet;
return $return_html;
}
diff --git a/full_download.inc b/full_download.inc
index 54cfdb8..dd5be9b 100755
--- a/full_download.inc
+++ b/full_download.inc
@@ -13,6 +13,7 @@ function om_flowsheet_download_full_project()
$FLOWSHEET_PATH = $flowsheet_data->directory_name . '/';
/* zip filename */
$zip_filename = $root_path . 'zip-' . time() . '-' . rand(0, 999999) . '.zip';
+ //var_dump($zip_filename);die;
/* creating zip archive on the server */
$zip = new ZipArchive();
$zip->open($zip_filename, ZipArchive::CREATE);
@@ -28,7 +29,9 @@ function om_flowsheet_download_full_project()
$zip->addFile($root_path . $FLOWSHEET_PATH . '/' . $flowsheet_f_row->filepath, $FLOWSHEET_PATH . str_replace(' ', '_', basename($flowsheet_f_row->filename)));
} //$flowsheet_f_row = $flowsheet_f_q->fetchObject()
$zip_file_count = $zip->numFiles;
+ //var_dump($zip_file_count);die;
$zip->close();
+ //var_dump(filesize($zip_filename));die;
if ($zip_file_count > 0) {
if ($user->uid) {
/* download zip file */
@@ -36,10 +39,11 @@ function om_flowsheet_download_full_project()
header('Content-disposition: attachment; filename="' . str_replace(' ', '_', $flowsheet_data->project_title) . '.zip"');
header('Content-Length: ' . filesize($zip_filename));
readfile($zip_filename);
- unlink($zip_filename);
- ob_clean();
ob_end_flush();
+ ob_clean();
flush();
+ unlink($zip_filename);
+
} //$user->uid
else {
header('Content-Type: application/zip');
@@ -49,10 +53,11 @@ function om_flowsheet_download_full_project()
header('Expires: 0');
header('Pragma: no-cache');
readfile($zip_filename);
- unlink($zip_filename);
- ob_clean();
ob_end_flush();
+ ob_clean();
flush();
+ unlink($zip_filename);
+
}
} //$zip_file_count > 0
else {
@@ -73,6 +78,7 @@ function om_flowsheet_download_completed_project()
$FLOWSHEET_PATH = $flowsheet_data->directory_name . '/';
/* zip filename */
$zip_filename = $root_path . 'zip-' . time() . '-' . rand(0, 999999) . '.zip';
+ var_dump($zip_filename);die;
/* creating zip archive on the server */
$zip = new ZipArchive();
$zip->open($zip_filename, ZipArchive::CREATE);
diff --git a/upload_code.inc b/upload_code.inc
index 14cba14..46cf993 100755
--- a/upload_code.inc
+++ b/upload_code.inc
@@ -152,7 +152,7 @@ function om_flowsheet_abstract()
$return_html .= '<strong>Name of compound for which process development is carried out:</strong><br />' . $prodata . '<br />';
$return_html .= '<strong>Uploaded an abstract (brief outline) of the project:</strong><br />' . $abstract_filename . '<br /><br />';
$return_html .= '<strong>Upload the OpenModelica flowsheet for the developed process:</strong><br />' . $abstracts_query_process_filename . '<br /><br />';
- $return_html .= '<strong>Version of the library used for OpenModelica flowsheet for the Simulator package:</strong><br />' . $simulator_version_used_name . '<br /><br />';
+ $return_html .= '<strong>Simulator version used for creating the flowsheet:</strong><br />' . $simulator_version_used_name . '<br /><br />';
$return_html .= $url . '<br />';
return $return_html;
}