RE: [PHP] Identify a Word Document on the Fly
| From: | Nold, Mark | Date: | Tue, 26 Sep 2000 04:41:42 +0000 |
| Subject: | RE: [PHP] Identify a Word Document on the Fly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17518@lists.php.net to get a copy of this message | ||
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
Assuming you have something like <input name="userfile" type="file"> in
your
form to upload have a look at the MIME type (in this case $userfile_type)
## Notes;
echo "$userfile<BR>\n"; # The endlocation of the file
echo "$userfile_name<BR>\n"; # The actual name of the file
echo "$userfile_size<BR>\n"; # Size in bytes of file
echo "$userfile_type<BR>\n"; # MIME Type (Depends on the browser if this is
supplied)
-----Original Message-----
From: Andreas Pour [mailto:pour@mieterra.com]
Sent: Sunday, September 24, 2000 5:54 AM
To: Van
Cc: php-general@lists.php.net
Subject: Re: [PHP] Identify a Word Document on the Fly
Van wrote:
>
> Greets, all:
>
> Been many moons since I've been on the php list.
>
> I'm building a resume uploader utility and using the input type=file tag
> to pitch the browse dialog to the end user. On submit, I'd like to stream
> the file into a size-limited variable. I don't allow the web applications
> to write to the file system. The data will go into a MySQL BLOB field
> along with any other identification data.
>
> My question is, has anyone worked with the Word proprietary document
> format to the extent they can identify that it is a word document?
Hi,
$ file resume.doc
resume.doc: Microsoft Office Document
Easier than writing your own ;-).
Ciao,
Andreas Pour
http://www.kde.com/ : Everything KDE
http://apps.kde.com/: The Latest in KDE Applications