🐛 Fix file download issues

Signed-off-by: Luke Tainton <luke@tainton.uk>
This commit is contained in:
2020-08-09 20:30:01 +01:00
parent 6c157bf03d
commit f6688e5020
2 changed files with 3 additions and 3 deletions

View File

@@ -76,10 +76,10 @@
return $result;
}
function get_single_file($db, $file) {
function get_single_file($db, $fileid) {
$stmt = "SELECT * FROM ticket_uploads WHERE id=:fileid";
$sql = $db->prepare($stmt);
$sql->bindParam(':fileid', $file['id']);
$sql->bindParam(':fileid', $fileid);
$sql->execute();
$sql->setFetchMode(PDO::FETCH_ASSOC);
$result = $sql->fetchAll();

View File

@@ -128,7 +128,7 @@
<span style="display: inline;"><b><?php echo(get_user_name($db, $file['user'])); ?></b></span><span class="text-muted"><i> <?php echo(" " . $file['created']); ?></i></span>
</div>
<div class="row">
<a target="_blank" href="<?php echo('/actions/download?file=' . $file['id']); ?>"><span><?php echo($file['path']); ?></span></a>
<a target="_blank" href="<?php echo('/actions/download?file=' . $file['id']); ?>"><span><?php echo($file['filename']); ?></span></a>
</div>
</div>
</li>