TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   upload file (http://www.talkphp.com/absolute-beginners/3102-upload-file.html)

galleeandfarel 07-11-2008 07:08 AM

upload file
 
my design code is
<form action="upload.php" method="post" enctype="multipart/form-data">
File: <input type="file" name="filename" />
<input type="submit" value="Upload" />
</form>

php code is

<?php
$folder = "C:\wamp\www\vgotjobs\upload";
if (is_uploaded_file($HTTP_POST_FILES['filename']['tmp_name'])) {
if (move_uploaded_file($HTTP_POST_FILES['filename']['tmp_name'],$folder.$HTTP_POST_FILES['filename']['name'])) {
Echo "File uploaded";
} else {
Echo "File not moved to destination folder. Check permissions";
};
} else {
Echo "File is not uploaded.";
};
?>



above are my upload php codes,
when i run in the localhost,it tells
"FILE IS NOT UPLODED"
plz give me a hint to upload files in my temp folder......

netsnake 07-11-2008 10:31 AM

try replacing $HTTP_POST_FILES['filename']['tmp_name'] by $HTTP_POST_FILES['tmp_name'] (in all cases, line 3, and both in 5)

Greez,
netsnake

galleeandfarel 07-11-2008 11:23 AM

thank for the reply dude...ive changed "$HTTP_POST_FILES" to "$_FILES"....it is working now.....:-)


All times are GMT. The time now is 02:39 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0