diff options
author | Sashi20 | 2017-07-25 11:04:22 +0530 |
---|---|---|
committer | GitHub | 2017-07-25 11:04:22 +0530 |
commit | d22aceb3eaceaf73d51a053bbebc6996f274a935 (patch) | |
tree | 958527516982f995c2cad840ecdcb90eff8c1961 | |
parent | 4bf223904644f67330582008c7c127d345d0c09b (diff) | |
download | dwsim_flowsheet-d22aceb3eaceaf73d51a053bbebc6996f274a935.tar.gz dwsim_flowsheet-d22aceb3eaceaf73d51a053bbebc6996f274a935.tar.bz2 dwsim_flowsheet-d22aceb3eaceaf73d51a053bbebc6996f274a935.zip |
File replace after upload issue fixed (#8)
-rwxr-xr-x | upload_code.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/upload_code.inc b/upload_code.inc index f27f602..7ad3299 100755 --- a/upload_code.inc +++ b/upload_code.inc @@ -847,7 +847,7 @@ function dwsim_flowsheet_upload_abstract_code_form_submit($form, &$form_state) )), 'error'); } //file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]) /* uploading file */ - if (move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name])) + else if (move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name])) { /* for uploaded files making an entry in the database */ $query_ab_f = "SELECT * FROM dwsim_flowsheet_submitted_abstracts_file WHERE proposal_id = :proposal_id AND filetype = @@ -901,13 +901,13 @@ 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]); drupal_set_message(t("File !filename already exists hence overwirtten the exisitng file ", array( '!filename' => $_FILES['files']['name'][$file_form_name] )), 'error'); } //file_exists($root_path . $dest_path . $_FILES['files']['name'][$file_form_name]) /* uploading file */ - if (move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name])) + else if (move_uploaded_file($_FILES['files']['tmp_name'][$file_form_name], $root_path . $dest_path . $_FILES['files']['name'][$file_form_name])) { /* for uploaded files making an entry in the database */ $query_ab_f = "SELECT * FROM dwsim_flowsheet_submitted_abstracts_file WHERE proposal_id = :proposal_id AND filetype = |