trouble with file upload page using PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am testing a page that uploads a file to my server using PHP.

I get an error stating:

"Warning: copy(/hsphere/local/home/bruceg/inspired-evolution.com/LOR-BRUCE.pdf):
failed to open stream: Permission denied in
/hsphere/local/home/bruceg/inspired-evolution.com/Uploader.php on line
4
Could not copy file"

the page is at http://inspired-evolution.com/Uploader.php

and the PHP code is:

<?php
    if( $_FILES['file'] ['name'] !="" )
    {copy ( $_FILES ['file'] ['tmp_name'],
    "/hsphere/local/home/bruceg/inspired-evolution.com/".$_FILES['file']['name'])
    or die ( "Could not copy file" );
    }
    else{ die ( "No file specified" ) ; }
    ?>

<ul>
<li> Sent: <?php echo $_FILES ['file'] ['name']; ?></li>
<li>Size: <?php echo $_FILES ['file'] ['size']; ?> bytes </li>
<li>Type: <?php echo $_FILES ['file'] ['type']; ?>
</ul>
<a href="<?php echo $_FILES ['file'] ['name'] ; ?>"
View File</a>

is there a way to accomplish this by adding something to the script above?

thanks,

Bruce

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux