Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

Postin Pictures

This is a discussion on "Postin Pictures" within the PHP Forum section. This forum, and the thread "Postin Pictures are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 23rd, 2006, 21:39
Junior Member
Join Date: Jun 2006
Location: usa
Age: 30
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Postin Pictures

I will be postin Pictures along with some information

the problems is that it seems that the HTML form is not getting the pictures.

this is the HTML Form:

PHP: Select all

<input type="hidden" name="MAX_FILE_SIZE" value="1000">
Picture1 (Front Business)<input name="picture1" type="file"
this is the php codes

PHP: Select all

 
<?php
if ($picture1=="none")
{
echo 
"Problem: no file uploaded";
exit;
}
 
$upfile " /httpdocs/images/".$picture1_name;
if ( !
copy($picture1$upfile))
{
echo 
"Problem: Could not move file into directory";
exit;
}
 
echo 
"File uploaded successfully<br><br>";
$fp fopen($upfile"r");
$contents fread ($fpfilesize ($upfile));
fclose ($fp);
$contents strip_tags($contents);
$fp fopen($upfile"w");
fwrite($fp$contents);
fclose($fp);
echo 
"Preview of uploaded file contents:<br><hr>";
echo 
$contents;
echo 
"<br><hr>";
?>
this is the error i am getting...

Warning: Unable to open 'C:\\Documents and Settings\\HP_Owner\\Desktop\\naztel1.gif' for reading: No such file or directory in /home/httpd/vhosts/mass-ad.com/httpdocs/insert_data.php on line 118
Problem: Could not move file into directory


any advise on how i can fix this problem... thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jun 24th, 2006, 08:23
Reputable Member
Join Date: Feb 2006
Location: London
Age: 26
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Re: Postin Pictures

Have you got permission to write to the directory?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 24th, 2006, 14:33
Junior Member
Join Date: Jun 2006
Location: usa
Age: 30
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Postin Pictures

i dont know if i have permission how do i know if i have permission but i should have permission i am the the administrator and root
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 24th, 2006, 15:22
Reputable Member
Join Date: Feb 2006
Location: London
Age: 26
Posts: 103
Thanks: 0
Thanked 1 Time in 1 Post
Re: Postin Pictures

Your error message seems to suggest that the file dosen't exist. Sorry I should have picked up on that before...

Why do you have two slashes to seperate directories in the warning message?

Can you post the entire form if that dosen't solve the problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 24th, 2006, 16:18
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Postin Pictures

It looks like you need to turn off magic_quotes_gpc or maybe stripslashes from $upfile.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 24th, 2006, 16:51
Junior Member
Join Date: Jun 2006
Location: usa
Age: 30
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Postin Pictures

i made those changes and still, i thought uploading pictures was a lot easier



PHP: Select all

 
<?php
$picture1
=$_FILES['picture1']['tmp_name'];
var_dump($_FILES);
if (
$picture1=="none")
{
echo 
"Problem: no file uploaded";
exit;
}
 
$upfile "images/$picture_name";
print_r ($Picture1);
echo 
"File uploaded successfully<br><br>";
$fp fopen($upfile"r");
fclose ($fp);
 
$fp fopen($upfile"w");
fwrite($fp);
fclose($fp);
echo 
"Preview of uploaded file contents:<br><hr>";
echo 
"<br><hr>";
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
postin, pictures

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing pictures in rows casho Website Planning 9 Nov 29th, 2007 18:46
Pictures VanessaJW Webforumz Cafe 36 May 22nd, 2007 17:15
php uploading pictures Accurax PHP Forum 16 Dec 18th, 2006 12:20
Resizing Pictures Accurax Web Page Design 9 Dec 14th, 2006 19:05
gap between pictures maksinx Graphics and 3D 9 Aug 15th, 2006 18:19


All times are GMT. The time now is 16:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8