Post by JSamuel » Sat Jan 02, 2010 7:30 pm

This is just a simple fix for Downloads to fix filenames with spaces, as there is a bug in catalog/controller/account/download.php which when the file is downloaded, it will only have the filename of the first word in the original filename.

(eg, the original filename could be "some mp3 file.mp3" instead, it would be downloaded as "some")

To fix this problem, locate line 174:

Code: Select all

header('Content-Disposition: attachment; filename=' . ($mask ? $mask : basename($file)));
and replace it with:

Code: Select all

header("Content-Disposition: attachment; filename=\"" . basename($file) . "\"");
regards,
Jordan Samuel.

Newbie

Posts

Joined
Sat Jan 02, 2010 3:25 pm

Post by readyman » Mon Jan 04, 2010 8:37 am

Thanx Jordan.

http://www.alreadymade.com
Follow me on twitter.com/alreadymade


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney

Post by united » Wed Aug 31, 2011 5:23 pm

Above fixes issue with filename with spaces getting truncated, however it was then adding some stuff to the end of the filename.

Below fixes the issue:

instead of:

Code: Select all

header('Content-Disposition: attachment; filename=' . ($mask ? $mask : basename($file)));
use:

Code: Select all

header('Content-Disposition: attachment; filename="' . ($mask ? $mask : basename($file)) . '"');

User avatar
Newbie

Posts

Joined
Sun Aug 21, 2011 9:48 am
Location - San Diego, California

Post by uksitebuilder » Wed Aug 31, 2011 6:46 pm

I have knocked up a vQmod file for this fix - thanks for the code

Files affected are:

catalog/controller/account/download.php
admin/controller/sale/order.php

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: No registered users and 10 guests