Need Some HTTP_HEADER Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Need Some HTTP_HEADER Help

Post by snowrhythm »

Hi all, I'm writing a script to upload some files to a mysql DB and I've heard that you can just extract bits from the HTTP_HEADER
to get things like the file type, file size, and file name. Is this true? If so...those three things are just what I need, and i't d be fantastic
if someone could let me know how to do this. Thanks in advance.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

stat() perhaps?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The details found on the following may be of more use.

http://php.net/features.file-upload

Also, be aware that the type specified in $_FILES is unreliable. Analyze the file's contents. mime_content_type() may be of interest there.
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Post by snowrhythm »

Hey thanks guys, both of those helped alot. Cheers -
Post Reply