How to detect Windows vs Mac files upon user upload ??

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
mgm_03
Forum Newbie
Posts: 20
Joined: Thu Aug 07, 2003 3:49 pm

How to detect Windows vs Mac files upon user upload ??

Post by mgm_03 »

We have a need to ensure a user is uploading an acceptable file format (image artwork). The company only supports Windows and would like to know if it's possible to discern between Windows and Mac. Then let the user know the file was acceptable or not.

Is file platform detection possible with PHP?

Does anyone have thoughts?

TIA !!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

most file formats use a specific byte order. For the formats that don't, which is few, they normally have a byte order marker/indicator inside the file format. TIFF's for example have a two byte marker that shows which order (big-endian or little-endian) the data was written in. MP3s have the same sort of form.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

..and turn off "Notify on reply", read my sig for additional details.
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

are u asking to see what OS the visitor uses??

$_SERVER['HTTP_USER_AGENT'];
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

feyd wrote:..and turn off "Notify on reply", read my sig for additional details.
--feyd
That helps.. :P
mgm_03
Forum Newbie
Posts: 20
Joined: Thu Aug 07, 2003 3:49 pm

Post by mgm_03 »

Thanks for all replies.
..and turn off "Notify on reply", read my sig for additional details.
pardon my density ...if notify is turned off, how do I know if someone has replied to a post? Where are the "additional details"?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's already fixed.. ignore that.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

mgm_03 wrote:pardon my density ...if notify is turned off, how do I know if someone has replied to a post? Where are the "additional details"?
By checking back to the forum?
We have a rather lively forum, all posts are usually answered/responded to in a few hours.
Post Reply