/    Sign up×
Community /Pin to ProfileBookmark

Creating directory to upload pictures

Ok, I am trying to upload a picture here but it seems it is no collecting the picture.
it also seems that it is not finding the folder that i assign to it

any help here on how i can accomplish this thank you.

Ok I have a HTML form, where all the info is inserted and then,It will be call later.

here is the HTML form:

[code=php]
<input type=”hidden” name=”MAX_FILE_SIZE” value=”1000″>
Picture1 (Front Business)<input name=”picture1″ type=”file”>
[/code]

here ‘s the php

[code=php]
<?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 ($fp, filesize ($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>”;

?>
[/code]

and this is that i am dispalying

Warning: Unable to open ‘C:Documents and SettingsHP_OwnerDesktoptownsfinder0036.jpg’ 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

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@franknuauthorJun 24.2006 — Warning: Unable to open '' for reading: No such file or directory in /home/httpd/vhosts/mass-ad.com/httpdocs/insert_data.php on line 119

Problem: Could not move file into directory

this is the message that i am gettin now

Warning: fopen("images/", "w") - Is a directory in /home/httpd/vhosts/mass-ad.com/httpdocs/insert_data.php on line 131

Warning: Supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mass-ad.com/httpdocs/insert_data.php on line 132

Warning: Supplied argument is not a valid File-Handle resource in /home/httpd/vhosts/mass-ad.com/httpdocs/insert_data.php on line 133

Preview of uploaded file contents:
Copy linkTweet thisAlerts:
@NogDogJun 24.2006 — Have you looked at the sticky thread at the top of the PHP forum posted by Bokeh on uploading images? I think it might deal with most of your problems.
×

Success!

Help @franknu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...