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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reference HTTP_POST_FILES for the filename?

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
US
I am uploading a file and I want to get the filename.

I thought this worked but I was WRONG!:

HTTP_POST_FILES["fieldname"][name]
- or -
HTTP_POST_FILES["fieldname"]["name"]

Nope, no good.

How do I do it?

 
HTTP_POST_FILES? does that exists?

don't you mean HTTP_POST_VARS ?

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
think this may be what you mean ...


if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
$upload_file = file($HTTP_POST_FILES['userfile']['tmp_name']);
echo "found this file: $uploaded_file";
}else {
echo "bugger all here";
}
***************************************
Party on, dudes!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top