RE: [PHP] MAC file upload
| From: | Rance Hall | Date: | Mon, 08 Apr 2002 14:59:49 +0000 |
| Subject: | RE: [PHP] MAC file upload | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92056@lists.php.net to get a copy of this message | ||
Shane,
Eric is absolutely right, you are losing the resource fork of your mac binaries when you upload
them.
(If you don't know, on a Mac, the binary file has to parts, the data, and the association with
an application (or resource) that created the file. This is done so that Mac file names don't
need an extension)
Most server systems (except Mac of course) don't know how to handle a resource fork, so they
drop it. The standard Mac work around is to convert the binary file to a text format called binhex
(.hqx filename extension) upload the .hqx file to the server and then reconvert it back once
downloaded to a Mac that knows what to do with the resource fork information.
This process can be automated with apple script if you like, but, if you ever want another machead
to help you diagnose problems, stick to this layout, that way they know what you are doing.
Rance
Rance Hall
308.238.2455
Internal Office Extensions: 2455 or 6655
PC Programmer, The Buckle, Inc.
rance.hall@buckle.com
-----Original Message-----
From: Erik Price [mailto:pricee@hhbrown.com]
Sent: Monday, April 08, 2002 8:46 AM
To: Shane McBride
Cc: php-general@lists.php.net
Subject: Re: [PHP] MAC file upload
On Saturday, April 6, 2002, at 11:44 AM, Shane McBride wrote:
> Hello,
>
> I am able to upload and download Macintosh files but they seem to lose
> their
> MIME type or extensions. I'm not sure what it is. I'm not a Mac dude.
>
> When you download the file It loses the file association. It's for a
> company
> I do work for that uses a lot of .ai and .psd files.
>
>
> Any ideas on this?
You're possibly losing the resource fork of the files you are uploading,
because the server is not an HFS+ filesystem. To the best of my
knowledge there is nothing you can do about this via PHP, but there are
probably tricks (like AppleScript) that you could use as a workaround,
such as encoding the files in some transport-friendly format before
uploading and decoding them upon download.
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
pricee@hhbrown.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php