fixed bug in file attachment

This commit is contained in:
alejandro.campos@artica.es 2021-05-05 09:51:21 +02:00
parent f0f7244d84
commit 256750bcb0
1 changed files with 4 additions and 2 deletions

View File

@ -159,7 +159,9 @@ if ($upload_file && ($_FILES['userfile']['name'] != '')) {
$filecontent = base64_encode(file_get_contents($_FILES['userfile']['tmp_name']));
$result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', ';');
$filename = str_replace(' ', '+', $filename);
$result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', '|;|');
// API method returns '0' string if success.
$file_added = ($result_api_call === '0') ? true : false;
@ -485,4 +487,4 @@ $(document).ready (function () {
});
});
</script>
</script>