From commits-return-20583-archive-asf-public=cust-asf.ponee.io@airavata.apache.org Wed May 22 19:15:47 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B95D9180651 for ; Wed, 22 May 2019 21:15:46 +0200 (CEST) Received: (qmail 28970 invoked by uid 500); 22 May 2019 19:15:46 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 28961 invoked by uid 99); 22 May 2019 19:15:45 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 May 2019 19:15:45 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D512C85D97; Wed, 22 May 2019 19:15:45 +0000 (UTC) Date: Wed, 22 May 2019 19:15:45 +0000 To: "commits@airavata.apache.org" Subject: [airavata-php-gateway] branch tus-integration updated: Creating sym links for input files larger that 1 GB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155855254576.16318.15889371647743854006@gitbox.apache.org> From: dimuthuupe@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: airavata-php-gateway X-Git-Refname: refs/heads/tus-integration X-Git-Reftype: branch X-Git-Oldrev: 224879ed966e289edbbf2ac789319c0436ec9ef9 X-Git-Newrev: 4407c6bfc96fa3a78a12a0833c39644aea8e59d5 X-Git-Rev: 4407c6bfc96fa3a78a12a0833c39644aea8e59d5 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. dimuthuupe pushed a commit to branch tus-integration in repository https://gitbox.apache.org/repos/asf/airavata-php-gateway.git The following commit(s) were added to refs/heads/tus-integration by this push: new 4407c6b Creating sym links for input files larger that 1 GB 4407c6b is described below commit 4407c6bfc96fa3a78a12a0833c39644aea8e59d5 Author: Dimuthu Wannipurage AuthorDate: Wed May 22 14:28:30 2019 -0400 Creating sym links for input files larger that 1 GB --- app/libraries/ExperimentUtilities.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php index 58a1445..997a824 100755 --- a/app/libraries/ExperimentUtilities.php +++ b/app/libraries/ExperimentUtilities.php @@ -410,6 +410,8 @@ class ExperimentUtilities if (isset($_POST[$applicationInput->sanitizedFormName]) && (trim($_POST[$applicationInput->sanitizedFormName]) != '')) { + Log::info('Processing input ' . $applicationInput->sanitizedFormName); + $tus_data_dir = "/data/gateway-user-data/tus-temp-dir/"; $tus_download_url = trim($_POST[$applicationInput->sanitizedFormName]); $file_uuid = explode("/", $tus_download_url)[4]; @@ -436,7 +438,21 @@ class ExperimentUtilities CommonUtilities::print_warning_message('Uploaded file already exists! Overwriting...'); } - $moveFile = copy($tus_bin_file, $filePath); + Log::info('Starting the file movement from ' . $tus_bin_file . ' to ' . $filePath); + + $bin_file_size = filesize($tus_bin_file) / (1000 * 1000 * 1000); + Log::info('File size ' . $bin_file_size); + + if ($bin_file_size > 1) { + Log::info("Creating sym link as the file size is too large"); + $moveFile = symlink($tus_bin_file, $filePath); + } else { + Log::info("Copying the file ..."); + $moveFile = copy($tus_bin_file, $filePath); + } + + Log::info('File moved to storage ' . $filePath); + if (!$moveFile) { CommonUtilities::print_error_message('

Error moving uploaded file ' . $file_name . '! Please try again later or report a bug using the link in the Help menu.

');