problem uploading a picture
Moderator: General Moderators
orrrrrrrr........ use a relative path 
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
ok changes made
same result
code
here is my display
same result
code
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 Uploadedmade some changes
and now i am displaying something diffrence..
my code
my display
and now i am displaying something diffrence..
my code
Code: 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('./');
}
?>my display
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- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Have you read the manual on what realpath() does?