LassoScript Utility
Basics Browse Detail

[File_Stream]

Tag Link [File_Stream] Category Output
Type Process Source Available Yes
Support Preferred Version 7.0.2
Change Unchanged Data Source Any
Output Type None Security None
Implementation LDML Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

The [File_Stream] tag incrementally serves a file on the server in place of the current Lasso format file. This tag is simialr to [File_Serve], but does not read the entire file into memory before serving it. This allows it to serve large files efficiently.

The name of the file can be specified and, in supported browsers, the file will be written to disk using that name and/or displayed in the browser. The [File_Stream] tag can be used to serve image files, multimedia files, file archives, or even HTML files.

None of the contents of the current format file will be served. [File_Stream] completely rewrites the HTTP headers and contents of the served response. [File_Stream] also performs an [Abort] so no tags after [File_Stream] will be executed.

A -File parameter sets the name and path of the file to be streamed. An optional -Name parameter specifies the name of the file as it will be served. An optional -Type parameter allows the MIME type of the served file to be overridden.

The default MIME type is application/octet-stream. Other possible MIME types include:

- text/html - HTML text
- image/jpeg - JPEG graphic file
- image/gif - GIF graphic file
- image/png - PNG graphic file
- text/xml - XML data
- application/pdf - Portable Document Format file
- video/mpeg - Movie file

Syntax

[File_Stream: -File='///Library/Webserver/Documents/example.mpg', -Name='example.mpg', -Type='video/mpeg']

Parameters

Required Parameters
-File The path to the file to be served.
Optional Parameters
-Name The name of the file which the site visitor will see. Defaults to the actual name of the file.
-Type The MIME type for the served file. Defaults to application/octet-stream.
-Buffer The buffer size in bytes. Defaults to 32768.

Examples

See the Lasso 8 Language Guide for examples of how to use this tag.