DOCman 1.4 RC3: Error Uploading. Directory Problem. *FIX*
I have verified that this fix works, and that it is, in fact, a bug in the latest release.
EDIT: (8.11.08) Please make sure you change the quotes once you copy in the code. Wordpress will alter them, so you need to copy the code into your files and then delete each quote and retype it. It should clear a lot of the PHP errors everyone’s getting, since it doesn’t know how to handle them, and is resulting in unpredictable behavior.
EDIT: (8.27.08) The paths to the files are as follows:
JOOMLA/components/com_docman/includes_frontend/upload.http.php
JOOMLA/administrator/components/com_docman/includes/files.php
JOOMLA/administrator/components/com_docman/classes/DOCMAN_file.class.php
Where JOOMLA is the root / home folder of the joomla installation (not to be confused with the root folder of the server).
Hello I’ve had the error message “error uploading. directory problem” with DOCman 1.4 RC3, debugged the code and found the solution - it is a bug in RC3:Effect:
- Error message: “error uploading. directory problem”, after step 2 of uploading a new file,Occurrence:
- with docman 1.4 RC3, (not with RC1)
- on windows-based webservers (directory paths with backslash)
- if in PHP configuration “magic_quotes_gpc” is set to “on”
Reason:
Bug in RC3:
“DOCMAN_Utils::stripslashes()” removes backslashes in [’tmp_name’], what should NOT be done!!
- in “com_docman/includes_frontend/upload.http.php”, Line 38
- in “com_docman/includes/files.php”, Line 177:
Solution:
In “com_docman/includes/files.php”, line 177
remove DOCMAN_Utils::stripslashes() function:
- incorrect: $file_upload = mosGetParam(DOCMAN_Utils::stripslashes($_FILES), ‘upload’);
- correct: $file_upload = mosGetParam($_FILES, ‘upload’);
In “com_docman/includes_frontend/upload.http.php”, line 38
remove DOCMAN_Utils::stripslashes() function:
- incorrect: $file = mosGetParam(DOCMAN_Utils::stripslashes($_FILES), ‘upload’);
- correct: $file = mosGetParam($_FILES, ‘upload’);
And instead: In “com_docman/classes/DOCMAN_file.class.php”, line 352
add DOCMAN_Utils::stripslashes() function:
- incorrect: $name = $file[’name’];
- correct: $name = DOCMAN_Utils::stripslashes($file[’name’]);
For more information on [’tmp_name’] and backslashes
- see http://ch2.php.net/features.file-upload#42280 (11-May-2004 03:08)
That worked for me. ![]()
Good luck!
Benno
July 23rd, 2008 at 11:31 pm
Thks Great fix (Y)(Y)
BTW www.ouagaguide.com is not done with joomla but oldscool code
July 24th, 2008 at 3:08 pm
Don’t work for me.
I did all you say step to step and now i have a new error: A filename is required
July 24th, 2008 at 5:56 pm
I would make sure you have the proper permissions on your folders (That’s the first thing they tell you to look at).
I’ve upgraded 3 other sites (4 in total) and the fix works.
Sorry it didn’t work.
August 5th, 2008 at 12:28 pm
Thanks but now I have this error:
A filename is required.
August 5th, 2008 at 12:34 pm
Yeah! It’s work fine.
The problem is copy+paste because changes the quotes. If you put the quotes equal the code rules!
Thanks a lot Benno!
August 6th, 2008 at 2:31 pm
i couldn’t find this directory :S
com_docman/includes/files.php
mine is just com_docman/inculde_frontend
please help..
August 6th, 2008 at 4:54 pm
Funny, i also get “Error Uploading. - No filename specified.”
Could there be a problem with this patching?
[b]EDIT[/b]
If i don’t apply the patch to DOCMAN_file.class.php (last of the 3) it works… probably this is because i run it on a local test site, in XP. Who knows.
August 11th, 2008 at 10:38 am
When trying to upload file this error shows:
A filename is required
plz help me.
August 15th, 2008 at 7:14 am
Thanks so much!
August 27th, 2008 at 9:22 pm
Am I correct that
com_docman/includes_frontend/upload.http.php
is in the directory
/components
and
com_docman/includes/files.php
is /administrator/components/com_docman
I want to make sure before I, newby, start messing with the code.
(I think this would also answer Fadi who says he can’t find
com_docman/includes/files.php).
Thanks
August 27th, 2008 at 9:43 pm
JOOMLA/components/com_docman/includes_frontend/upload.http.php
JOOMLA/administrator/components/com_docman/includes/files.php
JOOMLA/administrator/components/com_docman/classes/DOCMAN_file.class.php
Where JOOMLA is the root / home folder of the joomla installation (not to be confused with the root folder of the server).
I hope this helps and clears up some confusion.
August 27th, 2008 at 11:29 pm
Tried it (after I figured out that the files you mention are in different directories, it would help if you added that to your instructions) , it works!
Thanks!
September 4th, 2008 at 1:52 pm
I changed te code. but nothing happened. Still I can’t upload files from front end and didn’t give any error message.
November 8th, 2008 at 7:01 pm
GR8. worked. thanks
November 18th, 2008 at 3:12 pm
docman.class.php
//———–Langue Addin———————————–Line 313
function loadLanguage($type)
{
global $mosConfig_lang;
if (file_exists($this->getPath(’language’).’/’.$mosConfig_lang.’.’.$type.’.php’)) {
include_once ($this->getPath(’language’).’/’.$mosConfig_lang.’.’.$type.’.php’);
} else {
include_once ($this->getPath(’language’).’/english.’.$type.’.php’);
}
}
December 23rd, 2008 at 4:03 am
Thanks. it works. code in site musn’t copy paste. Because it gives mistake.
January 6th, 2009 at 10:24 am
thanks a million benno, nice work, can you debug my next php project? also a bonus, until this fix i was getting a file exceeded max size error, which was way off due to large limits i had set.
udamon
bob