Hi,
I have a big problem. I use php in filemanager. I setup the neccessary changes, and the upload is working into the UserFiles/File , Flash, Image, Media. But if I create subdirectoris into the File, Image, etc. directories it is created (for example UserFile/File/test) but when I try to upload a file into this subdirectory it won't work. The filemanager says its OK, but the file is not uploaded into that place. Have anybody an idea? Thnx
I have a big problem. I use php in filemanager. I setup the neccessary changes, and the upload is working into the UserFiles/File , Flash, Image, Media. But if I create subdirectoris into the File, Image, etc. directories it is created (for example UserFile/File/test) but when I try to upload a file into this subdirectory it won't work. The filemanager says its OK, but the file is not uploaded into that place. Have anybody an idea? Thnx
RE: Filemanager upload into subdirectories
Find the upload.php file
(editor/filemanager/upload/php/upload.php)
You need to amend this to include the correct sub-directory (already found by upload.php and given the name $sType) in the path created for the file upload and in the URL that is returned to the editor.
change:
$sFilePath = $sServerDir . $sFileName ;
to:
$sFilePath = $sServerDir . $sType . '/' . $sFileName ;
and change:
$sFileUrl = $Config["UserFilesPath"] . $sFileName ;
to:
$sFileUrl = $Config["UserFilesPath"] . $sType . '/' . $sFileName ;
RE: Filemanager upload into subdirectories
What I don't like is that I am able to upload to the root directory
"Image Properties / Upload"
But from
"Image Properties / Image Info / Browse server"
I am only able to see the content of the sub-directories. There seems to be no way to browse the root, (the directory below "Image", "Flash", "File", etc.). Or did I misconfigure this? I don't think so.
IMHO, uploading and the sub-directories work well, except for this hindrance I mention, and the amended code you provide.
John
RE: Filemanager upload into subdirectories
This is implemented in a patch for the PHP connector, at:
http://tinyurl.com/pepft
as a downloadable file and which has been online for 6 months now.
Unfortunately this has not yet been implemented into the core for v. 2.3.2, but I have encouraged FredCK to do so when he gets time.