You are here: PHP File Upload Restriction? « PHP Programming Language « IT news, forums, messages
PHP File Upload Restriction?

Posted by NinJA999 on 04/27/06 02:51

I have the following code to handle file uploads. There is a database
called "media". The error I keep getting will follow the code. The
upload data gets into the database fine; it seems to be storing the
file that causes a problem. Please help!

<?php
$link = mysql_connect ( "localhost", "ninja999_tsql", "MYPASS")
or die("Can't connect to database server");

mysql_select_db ("ninja999_testsql", $link)
or die ("Unable to select database");

$filetempname=$_FILES['file']['tmp_name'];
$filename=$_FILES['file']['name'];
$filetype=$_FILES['file']['type'];

$query = "INSERT INTO `media` VALUES ('','$filename','$filetype')";
$result = mysql_query($query);
$query = "SELECT * FROM `media` WHERE `filename` = '$filename'";
$result = mysql_query($query);
$newname = mysql_result($result,0,"id");
move_uploaded_file( $filetempname, "PLACE/".$newname.".dat");
mysql_close($link);
header( "location: PAGE.PHP" );
?>

ERROR:


Warning: move_uploaded_file(): open_basedir restriction in effect.
File(PLACE/9.dat) is not within the allowed path(s): (BLAHBLAH/tmp) in
BLAHBLAH/upload.php on line 17

 

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

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