Inserts a file into a package


CALL INSERT_FILE(packageId, filename, filetype, mimeType, desc, nameValue, rc
<, properties, propValue1, ...propValueN> );

Required Arguments

identifies the package.
Type:Numeric, Input
names the file, using the following syntax:
  • FILENAME: external_filename
  • FILEREF: sas_fileref
Type:Character, Input
specifies the file type, which must be TEXT or BINARY.
Type:Character, Input
specifies the MIME type, the value of which is determined by the user. Subscribers can filter packages based on MIME type. See Filtering Packages and Package Entries. For suggested values, see the Details section.
Type:Character, Input
describes the file.
Type:Character, Input
identifies a list of one or more space-separated name/value pairs, each in one of the following forms:
  • name
  • name=value
  • name="value"
  • name="single value with spaces"
  • name=(value)
  • name=("value")
  • name=(value1, "value 2",… valueN)
Name/value pairs are site-specific; they are used for the purpose of filtering.
Type:Character, Input
receives a return code.
Type:Numeric, Output

Optional Arguments

identifies a comma-separated list of optional property names. Valid property names are as follows:
  • PATH
Type:Character, Input
propValue1, …propValueN
specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter. Valid property values are defined as follows:
DESTINATION_FILENAME specifies a valid filename that will be the destination of the file being inserted into the package. The filename should not contain any path information. This property is supported by the archive, WebDAV, and SharePoint transports.
PATH indicates the relative path information for this file. The relative path is included as the name of the file when defined in the ZIP file. The specified path should not contain a drive or device letter, or a leading slash. All slashes should be forward slashes '/' as opposed to backslashes '\'. This property is recognized only by the archive transport. It is ignored by all other transports.
Type:Character, Input


The mimeType parameter is a user-specified MIME type that specifies the type of binary file or text file that is being published. Users might choose to document the supported values in order for publishers to use them or to use their own content strings.
Suggested MIME types include the following:
  • application/msword
  • application/octet-stream
  • application/pdf
  • application/postscript
  • application/zip
  • audio/basic
  • image/jpeg
  • image/gif
  • image/tiff
  • model/vrml
  • text/html
  • text/plain
  • text/richtext
  • video/mpeg
  • video/quicktime

Example: Using INSERT_FILE

The following example supplies a content string of Image/gif to provide more information about the type of binary file that is being inserted.
filename = 'filename:/tmp/Report.gif';
filetype ='binary';
desc = 'Report information';
nameValue = '';
mimetype = 'Image/gif';
CALL INSERT_FILE(packageId, filename, filetype,
   mimetype, desc, nameValue, rc);