Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 543
Product
FileUp
Version
3.3
Title
How do I preserve the resource fork in a file upload from a Mac?
Problem
HTTP uploads from browsers on a Mac platform can contain both a resource and data fork. The resource fork is the part of the file that lists the resources used by the system to handle the file, while the data fork is the file data itself.

If files are being uploaded from a Mac to be used on a Windows server, it is not desirable to save the resource fork. However, if FileUp is being used to upload and download files to and from a Mac, the resource fork should be preserved if possible.
Solution

How does FileUp manage a MacBinary upload?

If the upload is sent from a browser in MacBinary format, then both the resource and dataforks will be transmitted to the server.

The PreserveMacBinary property was added to version 3.3 of FileUp for flexibility when uploading files from a Mac. FileUp can preserve both the data and resource forks from a properly formatted MacBinary upload if the PreserveMacBinary property of the FileUp object is set to "true". The default setting of this property is false, meaning that FileUp will save only the data fork of the upload stream even if the resource fork is available. This property is only relevant when the upload is sent from the browser in MacBinary format. Note: FileUp does not provide MacBinary encoding or decoding functionality, it merely preserves the forks if they are sent by the browser.

This property needs to be set on the primary object before referencing any form elements.

Example:

<%
'--- Instantiate FileUp
Set upl = server.CreateObject("SoftArtisans.FileUp")
'--- Set PreserveMacBinary
upl.PreserveMacBinary = true
'--- Set other property
upl.Path = "c:\temp"
'---
'---
'--- rest of code

.
.
%>

For fine tuning, this property can be set on individual files. upl.form("File1").PreserveMacBinary can be changed or inherited from upl.PreserveMacBinary before final save is called.

How do I ensure that my Mac upload is sent in MacBinary format?

This is totally dependent on the Mac browser client behavior, and some browsers may not provide this functionality. If you are running Internet Explorer, we can provide the following suggestion: You can change the MacBinary settings using the IE Preferences. In the 'File Helpers' section there is a list of file types. If a particular file type is selected as 'Binary Data' and 'Macintosh File' then uploads of that type will always be in MacBinary format.

Created : 12/1/2002 12:00:00 AM (last modified : 12/4/2002 3:54:30 PM)
Rate this article!
Comments