Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File upload Problems
#21
(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.
Reply
#22
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.
Reply
#23
Spacecop, hang in there Cool 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:
        // copy file
        
if (!makeDir($settings->_contentDir $dir)) return false

so the function explodes a path into this:

PHP Code:
Array ( 
[
0] => 
[
1] => users 
[2] => schule 
[3] => www 
[4] => 
[5] => download 
[6] => 1048576 
[7] => 
[8] => 
[9] => ) 

and then you check if each element is a folder and if not, you recreate it with

PHP Code:
        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?
Reply
#24
so, below is my suggested replacement for this function in inc.FileUtils.php:

PHP Code:
function makeDir($path)
{
global 
$settings;
$path1 $settings->_contentDir//from config
$path2 substr_replace ($path"/"0strlen($path1));

    
$mkfolder $path1;
    
    
$path preg_split"/[\\\\\/]/" $path2 );
        
    for(  
$i=; 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....
Reply
#25
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!
Reply
#26
that was me Matteo ))))
Reply
#27
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!!!!!!!!
Reply
#28
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
Reply
#29
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....
Reply
#30
(08-12-2010, 07:55 PM)spacecop Wrote: 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....

it means that the file conversion will not be possible, because your host desabled this command... sorry... but you can still upload if you disable this option in settings
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)