You are here: trouble with file upload page using PHP « PHP « IT news, forums, messages
trouble with file upload page using PHP

Posted by Bruce Gilbert on 07/07/05 02:10

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация