You are here: PHP and uploading files « HTML « IT news, forums, messages
PHP and uploading files

Posted by Nonee on 11/14/31 11:27

Hello all,

Ok ok, I have searched the internet extensively and I cannot find
the answer to this. I have found many answers but none of which that
work. I am running an apache server on my end, local for testing, and
I have wrote a php page that will accept a file to be uploaded. See
below.


<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<span class="smHeader">Choose a file to upload: </span></td>
<td><input name="uploadFile" type="file" />

Then on the added.php file that I post to, I have

if ($_POST["password"] == "") // Blank for now so I don't have to
type it everytime. Btw, is this secure???
{
$last = $_POST["last"];
mkdir("C:\\apache2triad\\htdocs\\condolences\\".$last);
//local file will be replaced when posted
echo "Made it! ". $_FILES['uploadFile']['name'];
if ( move_uploaded_file ($_FILES['uploadFile']
['tmp_name'],"../uploads/{$_FILES['uploadFile'] ['name']}") )
{
print '<p> The file has been successfully uploaded
</p>';
}
else
{

// ...EXCLUDED. JUST USED FOR TESTING THE ERROR
}
}

?>

Notice the echo "Made it!".$files line. It posts the made it part but
nothing for the file. Now I created a ../uploads folder (which is in
the root, correct? I never could get the . or .. stuff right). But
it just will not work. Is it because I am running the server local?
Shouldn't be... Or is it something with the php.ini config or apache
config? Please help. This is really annoying...

Thanks,

Josh

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация