Posts: 68
Threads: 8
Joined: Aug 2010
Reputation:
0
(08-10-2010, 03:08 PM)matteo lucarelli Wrote: Your settings seem ok and the error message MUST be a hosting issue.
You should try to move the "data" directory somwhere else?
Are you shure that www is a real directory? Not a link?
In the latter case the path in the settings must be correct with the real path.
I support the above.
sometimes with Linux hosting, "www" is a symlink to "public_html" folder... so please check your folders.
Posts: 24
Threads: 6
Joined: Aug 2010
Reputation:
0
my home directory is on the hosting server ist /users/schule/www/
my URL is
http://schule.square7.ch/
These are the information from my hoster (square7.ch).
under the home directoy I make other subdirectories. In /1/ I uploaded your Script via FTP. Before I created a database via phpmyadmin.
I created a folder /users/schule/www/1/download chmod 777 and I recieved a error when I try to upload a file (as a test a pdf file 44kb).
I created a folder /users/schule/www/download chmod 777 and I recieved a error when I try to upload a file (as a test a pdf file 44kb).
I have no more ideas, suggestions or what ever. Seems to me that your script is not running on my hoster.
Posts: 68
Threads: 8
Joined: Aug 2010
Reputation:
0
08-12-2010, 02:20 PM
(This post was last modified: 08-12-2010, 02:31 PM by alekseyn.)
Spacecop, hang in there

I might have a solution for you... please do not use my suggestion yet...
Matteo... coding question for you:
this function causes the problem when the safe_mod or open_basedir is in effect:
function called by lines:
PHP Code:
<?php
// copy file
if (!makeDir($settings->_contentDir . $dir)) return false;
so the function explodes a path into this:
PHP Code:
<?php
Array (
[0] =>
[1] => users
[2] => schule
[3] => www
[4] => 1
[5] => download
[6] => 1048576
[7] => 1
[8] => 4
[9] => )
and then you check if each element is a folder and if not, you recreate it with
PHP Code:
<?php
if( !is_dir( $mkfolder ) ){
$res=@mkdir( "$mkfolder" , 0777);
if (!$res) return false;
}
so in this case, the restriction in effect, does not allow folder /users to be even checked... then my question is, why can't we just do the checking for any folder ONLY inside the $_contentDir? why checking the full path?
Posts: 68
Threads: 8
Joined: Aug 2010
Reputation:
0
08-12-2010, 03:26 PM
(This post was last modified: 08-12-2010, 03:27 PM by alekseyn.)
so, below is my suggested replacement for this function in inc.FileUtils.php:
PHP Code:
<?php
function makeDir($path)
{
global $settings;
$path1 = $settings->_contentDir; //from config
$path2 = substr_replace ($path, "/", 0, strlen($path1));
$mkfolder = $path1;
$path = preg_split( "/[\\\\\/]/" , $path2 );
for( $i=0 ; isset( $path[$i] ) ; $i++ )
{
if(!strlen(trim($path[$i])))continue;
$mkfolder .= $path[$i];
//echo $mkfolder." -> ";
if( !is_dir( $mkfolder ) ){
$res= @mkdir( "$mkfolder" , 0777);
if (!$res) return false;
}
$mkfolder .= DIRECTORY_SEPARATOR;
}
return true;
}
I am also attaching the modified file. PLEASE ALWAYS BACKUP YOUR FILES BEFORE ANY FILE REPLACEMENT OR MODIFICATION.
try is spacecop - use the attached file (replace yours in /inc/ folder) and let us know...
Matteo... please check my logic....
Posts: 181
Threads: 23
Joined: Feb 2010
Reputation:
0
Good solution spacecop,
I'll apply the patch in the next (1.10) version
BTW:
I cannot aswer to your why: I've not written all the code in LetoDMS!
Posts: 24
Threads: 6
Joined: Aug 2010
Reputation:
0
08-12-2010, 05:55 PM
(This post was last modified: 08-12-2010, 06:13 PM by spacecop.)
UNBELIEVABLE!!!! YOUR'RE GREAT!!! IT WORKS!!!!
Thank your very, very much!!!!
But I have another question. I uploaded a pdf file.
When I click on it I have two options: view online or download.
Download works, but online viewing is not possible.
Is there somewhere a file which I can modify to see various uploaded fils online? (For example: word, excel, powerpoint, openoffice documents, pdf, jpg, gif etc.)
And when I upload a document the script create automaticly a new folder named with the filename which I uploaded.
Is it possible that no folder will be created when I upload a file?
Thanks a lot again for your solution!!!!!!!!
Posts: 181
Threads: 23
Joined: Feb 2010
Reputation:
0
The view on line is browser dependable function (not every system has embedded viewers). You can set wich document will have view online option inside the inc/inc.Settings.php file modifing the variable:
var $_viewOnlineFileTypes
Posts: 24
Threads: 6
Joined: Aug 2010
Reputation:
0
ok.
I tried to upload a word file and recieved this error
Warning: exec() has been disabled for security reasons in /users/schule/www/1/inc/inc.ClassDocument.php on line 1599
Warning: Cannot modify header information - headers already sent by (output started at /users/schule/www/1/inc/inc.ClassDocument.php:1599) in /users/schule/www/1/op/op.AddDocument.php on line 166
What means that?
Sorry that I make so much trouble....