Skip to content

Commit

Permalink
Merge pull request #1071 from ThaMunsta/download-filename-fix
Browse files Browse the repository at this point in the history
Update expenses.php
  • Loading branch information
johnnyq authored Sep 26, 2024
2 parents cbcb793 + e3df5c0 commit e94aae7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion expenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@
if (empty($expense_receipt)) {
$receipt_attached = "";
} else {
$receipt_attached = "<a class='text-secondary mr-2' target='_blank' href='uploads/expenses/$expense_receipt' download='$expense_date-$vendor_name-$category_name-$expense_id.pdf'><i class='fa fa-file-pdf'></i></a>";
$path_info = pathinfo($expense_receipt);
$ext = $path_info['extension'];
$receipt_attached = "<a class='text-secondary mr-2' target='_blank' href='uploads/expenses/$expense_receipt' download='$expense_date-$vendor_name-$category_name-$expense_id.$ext'><i class='fa fa-file'></i></a>";
}

?>
Expand Down

0 comments on commit e94aae7

Please sign in to comment.