Help with file upload
| From: | Ahmed Shams | Date: | Mon, 10 Mar 2003 13:26:27 +0000 |
| Subject: | Help with file upload | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26230@lists.php.net to get a copy of this message | ||
I am trying to upload a file but the problem i am having is that i get no value if i used $HTTP_POST_FILES['userfile']['name'] .... i have my register globals on and everything but i just can't see what am i doing wrong. here is my code:
/*<?
-$dir = ".\Apache\htdoc\ ";
-$dir .= $_POST['img1'];
-$temp1 = $_POST['img1'];
-$filename = $HTTP_POST_FILES['img1']['name'];
-echo "filename is $filename<br>\n";
-$temp_file = $HTTP_POST_FILES["img1"]["tmp_name"];
-$file_type = $HTTP_POST_FILES["img1"]["type"];
-if($HTTP_POST_VARS['img1']['name'] != ""){
copy($temp1,$dir) or
die ("Couldn't copy the file");
-}else{
die("No input file specified");
-}
-?>
-<HTML>
-<BODY>
-<h1>Successful upload </h1>
-<p>
-You sent: <? print $_POST['img1']; ?>, a <? echo"$img1_size"; ?>
- byte file of type <? echo"$img1_type"; ?>. </p>
-</body>
-</html>
*/
please help me because i need this ASAP.. thank you all
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail