Page 1 of 1

[HOW TO] overwrite files in phoca download

Posted: 19 Nov 2009, 23:35
by Markstein
Hello,

I just wanted to share a tip here. For awhile I have been searching on how to overwrite files in phoca download via the backend.

Open up controllers > phocadownloadupload.php and go to line 190. You will see the following code:

Code: Select all

if (JFile::exists($filepath)) {
				if ($format == 'json') {
					header('HTTP/1.0 409 Conflict');
					jexit('Error. File already exists');
				} else {
					JError::raiseNotice(100, JText::_('Error. File already exists'));
					// REDIRECT
					if ($return) {
						$mainframe->redirect(base64_decode($return).'&folder='.$folder);
					}
					return;
				}
			}
Comment out that code by adding /* code here */. So the code will now look like this:

Code: Select all

/*if (JFile::exists($filepath)) {
				if ($format == 'json') {
					header('HTTP/1.0 409 Conflict');
					jexit('Error. File already exists');
				} else {
					JError::raiseNotice(100, JText::_('Error. File already exists'));
					// REDIRECT
					if ($return) {
						$mainframe->redirect(base64_decode($return).'&folder='.$folder);
					}
					return;
				}
			}*/
Upload your modified file to administrator > components > com_phocadownload > controllers

Now you can overwrite files via the backend. Hope this is of use to some phoca download users.

Mark

Re: [HOW TO] overwrite files in phoca download

Posted: 22 Nov 2009, 23:25
by Jan
Ok thank you for this info.

Jan