Downloads not able to resume

Phoca Download - download manager
theunsd
Phoca Member
Phoca Member
Posts: 11
Joined: 03 Aug 2008, 22:11
Contact:

Downloads not able to resume

Post by theunsd »

Hi,

I have noticed that files downloaded via Phoca Download don't support resuming. When I download the same file directly form the server, resuming works perfectly. How can I fix this?
coolz.co.za
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Downloads not able to resume

Post by Jan »

Hi, Phoca Download gives the file to the browser and prevent it from execution (it will be provided to download by the browser), so I have no idea why the resumnig doesn't work :(

Jan
If you find Phoca extensions useful, please support the project
theunsd
Phoca Member
Phoca Member
Posts: 11
Joined: 03 Aug 2008, 22:11
Contact:

Re: Downloads not able to resume

Post by theunsd »

Hi,

I've fixed this issue. What basically happened was because that the file is dumped to the browser by using a READ() the browser and the download manager assumed that the file had dynamic content, and that's why it wouldn't allow resume. I changed the module to .redirect to the applicable file instead. Now the downloads support resume.
coolz.co.za
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Downloads not able to resume

Post by Jan »

Great to hear it, Jan
If you find Phoca extensions useful, please support the project
pcwitchdoctor
Phoca Member
Phoca Member
Posts: 14
Joined: 24 Aug 2008, 03:25

Re: Downloads not able to resume

Post by pcwitchdoctor »

theunsd wrote: I changed the module to .redirect to the applicable file instead. Now the downloads support resume.
I'm having the same problem, how exactly do I fix this. What do you mean by 'changed the module to .redirect', how/where do I do that?
theunsd
Phoca Member
Phoca Member
Posts: 11
Joined: 03 Aug 2008, 22:11
Contact:

Re: Downloads not able to resume

Post by theunsd »

Hi,

This is for v1.0.1. Please make backups first.

IN /components/com_phocadownload/views/category/view.html.php

Find:

Code: Select all

}else {
				
					// Clears file status cache
					clearstatcache();
					
					$addHit	= $model->hit($downloadId);
				
					$fileWithoutPath	= basename($absFile);
					$fileSize 			= filesize($absFile);
					
					// Clean the output buffer
					ob_end_clean();
					
					header("Cache-Control: public, must-revalidate");
				    header('Cache-Control: pre-check=0, post-check=0, max-age=0');
				    header("Pragma: no-cache");
				    header("Expires: 0"); 
				    header("Content-Description: File Transfer");
				    header("Expires: Sat, 30 Dec 1990 07:07:07 GMT");
				    header("Content-Type: " . (string)$mimeType);
				    header("Content-Length: ". (string)$fileSize);
				    header('Content-Disposition: attachment; filename="'.$fileWithoutPath.'"');
				    header("Content-Transfer-Encoding: binary\n");
				    
				    @readfile($absFile);
				    exit;
				}
Replace:

Code: Select all

				}else {
					//$relfolder = PhocaDownloadHelper::getSettings('download_folder', 'phocadownload' );
					//$relfolder = str_replace(DS, '/', JPath::clean($relfolder))
					$mainframe->redirect (PhocaDownloadHelper::getSettings('download_folder', 'phocadownload' ).'/'.$absFile);
				    exit;
				}
IN /components/com_phocadownload/models/category.php
Find:

Code: Select all

		if ($this->_filename !='') {
			$absFile = str_replace('/', DS, JPath::clean($filePath['orig_abs_ds'] . $this->_filename));
Replace:

Code: Select all

		if ($this->_filename !='') {
			return $this->_filename;
coolz.co.za
pcwitchdoctor
Phoca Member
Phoca Member
Posts: 14
Joined: 24 Aug 2008, 03:25

Re: Downloads not able to resume

Post by pcwitchdoctor »

theunsd wrote:Hi,

This is for v1.0.1. Please make backups first.
Thanks for your help. I did the changes you posted above, now I get a 404 error. My downloaded files are in the phocadownload directory, but now when you click the download link, it gives the folling path:

The requested URL /downloads/category/phocadownload/FIA_GT_Championship_V1.0.exe was not found on this server.

"/downloads/category/" does not exist on my server, however, the file is in a Category called "Downloads", in a section called "rFactor Mods". The downloadable files are in /home/badc/domains/street-racers.info/public_html/phocadownload/
theunsd
Phoca Member
Phoca Member
Posts: 11
Joined: 03 Aug 2008, 22:11
Contact:

Re: Downloads not able to resume

Post by theunsd »

In your admin section:

Go to Components -> Phoca Download -> Settings

Whats the value of "Download Folder"?
coolz.co.za
pcwitchdoctor
Phoca Member
Phoca Member
Posts: 14
Joined: 24 Aug 2008, 03:25

Re: Downloads not able to resume

Post by pcwitchdoctor »

theunsd wrote:In your admin section:

Go to Components -> Phoca Download -> Settings

Whats the value of "Download Folder"?
It's set to phocadownload which was the download directory created when I installed the component and where all my downloadable files are.
theunsd
Phoca Member
Phoca Member
Posts: 11
Joined: 03 Aug 2008, 22:11
Contact:

Re: Downloads not able to resume

Post by theunsd »

Have you installed any SEO modules?
coolz.co.za
Post Reply