summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202017-08-10 10:02:14 +0530
committerSashi202017-08-10 10:02:14 +0530
commitf28f70b5727b17dec4986f01ccb1f871373028b1 (patch)
treedc0123c40b75b078ab987b2ee7f26037a6dfbd9b
parent186f22a5a955111184dd5989864cccddeebe5493 (diff)
downloaddwsim_flowsheet-f28f70b5727b17dec4986f01ccb1f871373028b1.tar.gz
dwsim_flowsheet-f28f70b5727b17dec4986f01ccb1f871373028b1.tar.bz2
dwsim_flowsheet-f28f70b5727b17dec4986f01ccb1f871373028b1.zip
Fixed issue of uploading files with same name
-rwxr-xr-xupload_code.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/upload_code.inc b/upload_code.inc
index 7ad3299..0770f9a 100755
--- a/upload_code.inc
+++ b/upload_code.inc
@@ -1,4 +1,4 @@
-<?php
+ <?php
// $Id$
function dwsim_flowsheet_abstract()
{
@@ -693,7 +693,6 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
if ($proposal_data)
{
$query = "UPDATE {dwsim_flowsheet_proposal} SET
-
dwsim_database_compound_name = :dwsim_database_compound_name
WHERE id = :proposal_id
@@ -745,7 +744,6 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
else
{
$query = "UPDATE {dwsim_flowsheet_submitted_abstracts} SET
-
unit_operations_used_in_dwsim= :unit_operations_used_in_dwsim,
thermodynamic_packages_used= :thermodynamic_packages_used,
logical_blocks_used=:logical_blocks_used,
@@ -842,6 +840,7 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
if (file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]))
{
//unlink($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
+ move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
drupal_set_message(t("File !filename already exists hence overwirtten the exisitng file ", array(
'!filename' => $_FILES['files']['name'][$file_form_name]
)), 'error');
@@ -901,7 +900,8 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
case 'A':
if (file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]))
{
- //unlink($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
+ //unlink($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
+ move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
drupal_set_message(t("File !filename already exists hence overwirtten the exisitng file ", array(
'!filename' => $_FILES['files']['name'][$file_form_name]
)), 'error');
@@ -964,6 +964,7 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state)
if (file_exists($root_path . $dest_path_udc . $_FILES['files']['name'][$file_form_name]))
{
unlink($root_path . $dest_path_udc . $_FILES['files']['name'][$file_form_name]);
+ move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name]);
drupal_set_message(t("File !filename already exists directory hence overwirtten the exisitng file ", array(
'!filename' => $_FILES['files']['name'][$file_form_name]
)), 'error');