Posted: Sat Oct 07, 2006 10:42 pm
orrrrrrrr........ use a relative path 
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$uploaddir = realpath ("C://Program Files//EasyPHP1-8//home//townsfinder//biz.pictures//");
$uploadfile = $uploaddir . basename($_FILES['Picture1']['name']);
if(!empty($_FILES['Picture1']))
{
var_dump($uploaddir);
var_dump($_FILES);
var_dump($_FILES['Picture1']['size']);
var_dump($_FILES['Picture1']['error']);
var_dump($_FILES['Picture1']['type']);
}
if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$_FILES['Picture1']['name']))
{
echo("File Uploaded");
}
else
{
echo ("file no uploaded!");
print_r($_FILES);
echo realpath('./');
}
?>Code: Select all
bool(false) array(1) { ["Picture1"]=> array(5) { ["name"]=> string(11) "beer1_l.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(41) "C:/Program Files/EasyPHP1-8\tmp\phpA4.tmp" ["error"]=> int(0) ["size"]=> int(3859) } } int(3859) int(0) string(11) "image/pjpeg" File UploadedCode: Select all
<?php
$uploaddir = realpath ("C://Program Files//EasyPHP1-8//home//townsfinder//");
$uploadfile = $uploaddir . basename($_FILES['Picture1']['name']);
if(!empty($_FILES['Picture1']))
{
var_dump($uploaddir);
var_dump($_FILES);
var_dump($_FILES['Picture1']['size']);
var_dump($_FILES['Picture1']['error']);
var_dump($_FILES['Picture1']['type']);
}
if (move_uploaded_file($_FILES['Picture1']['tmp_name'], $uploaddir .$_FILES['Picture1']['name']))
{
echo("File Uploaded");
}
else
{
echo ("file no uploaded!");
print_r($_FILES);
echo realpath('./');
}
?>Code: Select all
string(44) "C:\Program Files\EasyPHP1-8\home\townsfinder" array(1) { ["Picture1"]=> array(5) { ["name"]=> string(11) "beer1_l.jpg" ["type"]=> string(11) "image/pjpeg" ["tmp_name"]=> string(41) "C:/Program Files/EasyPHP1-8\tmp\phpC0.tmp" ["error"]=> int(0) ["size"]=> int(3859) } } int(3859) int(0) string(11) "image/pjpeg" File Uploaded