airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing bug
Date Tue, 05 Jul 2016 21:42:58 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop ae6d78bb4 -> 6bc768cad


fixing bug


Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/6bc768ca
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/6bc768ca
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/6bc768ca

Branch: refs/heads/develop
Commit: 6bc768cadc4e41d3134cc992a2277b2335b0bfb6
Parents: ae6d78b
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Jul 5 17:42:53 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Jul 5 17:42:53 2016 -0400

----------------------------------------------------------------------
 app/libraries/ExperimentUtilities.php | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6bc768ca/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index fdb191c..adf5738 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -432,8 +432,8 @@ class ExperimentUtilities
 
         if($_FILES['optInputFiles']){
             $uriList = "";
-            foreach($_FILES['optInputFiles'] as $file){
-                $filePath = ExperimentUtilities::$experimentPath . $file['name'];
+            for($i=0; $i < len($_FILES['optInputFiles']['name']); $i++){
+                $filePath = ExperimentUtilities::$experimentPath . $_FILES['optInputFiles']['name'][$i];
 
                 // check if file already exists
                 if (is_file($filePath)) {
@@ -442,10 +442,10 @@ class ExperimentUtilities
                     CommonUtilities::print_warning_message('Uploaded file already exists!
Overwriting...');
                 }
 
-                $moveFile = move_uploaded_file($file['tmp_name'], $filePath);
+                $moveFile = move_uploaded_file($_FILES['optInputFiles']['tmp_name'][$i],
$filePath);
 
                 if (!$moveFile) {
-                    CommonUtilities::print_error_message('<p>Error moving uploaded
file ' . $file['name'] . '!
+                    CommonUtilities::print_error_message('<p>Error moving uploaded
file ' . $_FILES['optInputFiles']['name'][$i] . '!
                         Please try again later or report a bug using the link in the Help
menu.</p>');
                     $experimentAssemblySuccessful = false;
                 }
@@ -521,6 +521,14 @@ class ExperimentUtilities
                     CommonUtilities::print_error_message('<p>Error uploading file '
. $file['name'] . ' !
                     Please try again later or report a bug using the link in the Help menu.');
                 }
+            }else if(is_array($file) and $file['name']){
+                for($i =0 ; $i< len($file['name']); $i++){
+                    if ($file['error'][$i] > 0) {
+                        $uploadSuccessful = false;
+                        CommonUtilities::print_error_message('<p>Error uploading file
' . $file['name'][$i] . ' !
+                    Please try again later or report a bug using the link in the Help menu.');
+                    }
+                }
             }
 
 


Mime
View raw message