PHP file Uploading HELP !!!!!!!!!!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sacfreak
Forum Newbie
Posts: 6
Joined: Tue Mar 11, 2003 3:10 am

PHP file Uploading HELP !!!!!!!!!!!!

Post by sacfreak »

<?php
//$uploadpath = '\\dte1\\purchase\\tmpuploads';
$source = $HTTP_POST_FILES['tryfile']['tmp_name'];
$dest = 'f:\\purchase\''.$HTTP_POST_FILES['tryfile']['name'];

if ( ($source != 'none') && ($source != '' ))
{

$size = $HTTP_POST_FILES['tryfile']['size'];
echo"Source:- $source Dest:- $dest<br>";
echo"Size:- $size<br>";

if (is_uploaded_file($HTTP_POST_FILES['tryfile']['tmp_name']))
{
echo"Uploaded file is present<br>";
if ( $dest != '' )
{
if (move_uploaded_file($source, $dest))
{
echo 'File successfully stored.<BR>';
} else
{
echo 'File could not be stored.<BR>';
}
}
}
}
else
{
echo 'File not supplied, or file too big.<BR>';
}

?>

I GET THE FOLLOWING ERROR AFTER THE EXECUTION OF THE SCRIPT.

Source:- C:\WINNT\php4511.tmp Dest:- f:\purchase\Counter (Graphical) - PHP.txt
Size:- 3538
Uploaded file is present
File could not be stored.
PHP Warning: move_uploaded_file(f:\purchase\Counter (Graphical) - PHP.txt) [function.move-uploaded-file]: failed to create stream: Permission denied in F:\purchase\sacupload.php on line 18 PHP Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINNT\php4511.tmp' to 'f:\purchase\Counter (Graphical) - PHP.txt' in F:\purchase\sacupload.php on line 18
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

did you set the permissions to be able to write on that folder?
User avatar
puckeye
Forum Contributor
Posts: 105
Joined: Fri Dec 06, 2002 7:26 pm
Location: Joliette, QC, CA
Contact:

Post by puckeye »

Also did you make sure that your form was set to send files?

Code: Select all

<form action="somephpfile.php" method="post" enctype="multipart/form-data">
This will enable you to send files.
bionicdonkey
Forum Contributor
Posts: 132
Joined: Fri Jan 31, 2003 2:28 am
Location: Sydney, Australia
Contact:

Post by bionicdonkey »

Post Reply