Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP file upload problems

Status
Not open for further replies.

intrivious

Programmer
Jan 17, 2006
6
US
Is there anything obviously wrong with this code? My form field is named 'file'. Whenever I try to upload a file, it fails.

Code:
	$SUB_DIR = "/email_list/";
	$FILE = $SUB_DIR . basename($HTTP_POST_FILES['file']['name']);
	
	if (move_uploaded_file($HTTP_POST_FILES['file']['tmp_name'], $FILE)) {	
		echo "<font color=green><b>File uploaded</b></font>";
	} else {
		echo "<font color=red><b>File not uploaded.</b></font>";
	}

Thanks in advance
 
Problem solved... I did not need the / before 'email_list'... Thanks anyways...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top