Upload Trouble shooting! ( 8 Views )

no kitty!
  1. Hi, I am having some problems trying to make an upload script..heres my script:

    Quote:

    <?php if ($HTTP_POST_VARS['action']) { ?>
    <HTML>
    <HEAD>
    <TITLE>File Upload Results</TITLE>
    </HEAD>
    <BODY BGCOLOR="WHITE" TEXT="BLACK">
    <P><FONT FACE="Arial, Helvetica, sans-serif"><FONT SIZE="+1">File Upload
    Results</FONT><BR><BR>
    <?php

    $uploadpath = '/www/www/customdsg/explore/admin/files/';
    $source = $HTTP_POST_FILES['file1']['tmp_name'];
    $dest = '';

    if ( ($source != 'none') && ($source != '' )) {

    $imagesize = getimagesize($source);

    switch ( $imagesize[2] ) {

    case 0:

    echo '<BR> Image is unknown <BR>';
    break;

    case 1:
    echo '<BR> Image is a GIF <BR>';
    $dest = $uploadpath.uniqid('img').'.gif';
    break;

    case 2:
    echo '<BR> Image is a JPG <BR>';
    $dest = $uploadpath.uniqid('img').'.jpg';
    break;

    case 3:
    echo '<BR> Image is a PNG <BR>';
    $dest = $uploadpath.uniqid('img').'.png';
    break;

    }

    if ( $dest != '' ) {

    if ( move_uploaded_file( $source, $dest ) ) {

    echo 'File successfully stored.<BR>';

    } else {

    echo 'File could not be stored.<BR>';

    }

    }

    } else {

    echo 'File not supplied, or file too big.<BR>';

    }

    ?>
    </FONT></P>
    </BODY>
    </HTML>
    <?php } else { ?>
    <HTML>
    <HEAD>
    <TITLE>File Upload</TITLE>
    </HEAD>
    <BODY BGCOLOR="WHITE" TEXT="BLACK">
    <P><FONT FACE="Arial, Helvetica, sans-serif"><FONT SIZE="+1">File
    Upload</FONT><BR><BR>

    If your browser is upload-enabled, you will see "Browse" (Netscape,
    Internet Explorer), or "..." (Opera) buttons below. Use them to
    select files to upload, then click the "Upload" button. After the
    files have been uploaded, you will see a results screen.<BR>

    <FORM METHOD="POST" ENCTYPE="multipart/form-data"
    ACTION="<?php echo $PHP_SELF;?>">

    <INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="800000">
    <INPUT TYPE="HIDDEN" NAME="action" VALUE="1">
    File 1: <INPUT TYPE="FILE" NAME="file1" SIZE="30"><BR><BR>
    <INPUT TYPE="SUBMIT" VALUE="Upload">
    </FORM>
    </FONT></P>
    </BODY>
    </HTML>
    <?php } ?>

    and my error is

    Warning: move_uploaded_file(/www/www/customdsg/explore/admin/files/img3f2fc1060f820.gif): failed to open stream: No such file or directory in /home/tnrstudi/www/www/customdsg/explore/dl/admin/upload.php on line 45

    Warning: move_uploaded_file(): Unable to move '/tmp/phpbi1eNi' to '/www/www/customdsg/explore/admin/files/img3f2fc1060f820.gif' in /home/tnrstudi/www/www/customdsg/explore/dl/admin/upload.php on line 45
    File could not be stored.

    Any Ideas why this is happening? :)

    (mrvzera, United Arab Emirates)

  2. any path defined with a leading / is deemed by Apache as starting from root - try adding

    /home/tnrstudi/ to the defined $uploadpath as your root is /home/ and not /www/

    (ilayda, Yemen)

  3. hmm I tried that but I am still getting that same error

    (ahmet, Syrian Arab Republic)



Related Topics ... (or search in 1.720.883 topics !)

trouble shooting (1)
v1 trouble shooting (3)
pc trouble shooting (7)
trouble shooting help (4)
trouble shooting help please (8)
trouble shooting a hp (11)
do you have trouble shooting? ever wish you had a bueller? (3)
hid trouble shooting (9)
help me! trouble shooting lg-37lc7d (1)




copyright © 2007-2031 Pfodere.COM ( 7 Pfoyihuee Online )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
0.4717