Onderwerp: upload script
Enkele bericht bekijken
Oud 9 January 2004, 17:22   #13
Pakspul
Banned
 
Pakspul's Avatar
 
Geregistreerd op: 11 February 2002
Locatie: Hengelo
Berichten: 12.521
Standaard

Probeer dit eens

PHP Code:

$upload_mode 
= (@ini_get('open_basedir') || @ini_get('safe_mode')) ? 'move' 'copy';

$source_filename $_FILES['userfile']['name'];

$destination_filename "/home/test/public_html/img/"$_FILES['userfile']['name'];

switch (
$upload_mode)
{
    case 
'copy':
        if ( !@
copy($source_filename$destination_filename) ) 
        {
            if ( !@
move_uploaded_file($source_filename$destination_filename) ) 
            {
                echo 
"er gaat toch iets mis.<br>"__LINE__;

                exit;
            }
        } 
        @
chmod('./' $source_filename0666);
        break;

    case 
'move':
        if ( !@
move_uploaded_file($source_filename$destination_filename) ) 
        { 
            if ( !@
copy($source_file$destination_filename) )
            {
                echo 
"er gaat toch iets mis.<br>"__LINE__;

                exit;
            }
        } 

        @
chmod($config['upload_dir'] . '/' $destination_filename0666);
        break;
}

echo 
"Pakspul heerscht";
exit; 
Pakspul is offline   Met citaat antwoorden