LassoScript Utility
Basics Browse Detail

[File_Uploads]

Tag Link [File_Uploads] Category File
Type Substitution Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type Array Security Tag
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

[File_Uploads] returns an array of maps representing the files which were uploaded. Each map contains information about one file including the following members:
- Path - The path to the temporary location where the uploaded file is stored. Also accessible as Upload.Name.
- File - A file object for the temporary file.
- Size - The size of the uploaded file in bytes. Also accessible as Upload.Size.
- Type - The type of the uploaded file. Also accessible as Upload.Type.
- Param - The name of the form parameter which the file was uploaded in.
- OrigName - The original name of the uploaded file (if provided) without any path information.
- OrigPath - The original path of the uploaded file (if provided). Also accessible as Upload.RealName.
- OrigExtension - The original file extensions of the uploaded file.

In addition the following legacy members are still reported.
- Upload.Name - The path to the temporary location of the file.
- Upload.Size - The size of the file in bytes.
- Upload.Type - The MIME type of the file.
- Upload.RealName - The name of the file which was uploaded.

Syntax

[File_Uploads]

Parameters

No Parameters Required.

Change Notes

Many elements were added to the maps contained in [File_Uploads] in Lasso Professional 8, but all the old elements were left unchanged for backward compatibility.

Examples

To display information about all the files that were uploaded:

Use the [Loop] ... [/Loop] tags to loop through the [File_Upload] tag. The following exampe displays all the stored information about each uploaded file.

The results are shown for a file name MyPicture.gif which uploaded in a form element named Picture.

[Loop: (File_Uploads->Size)]
  [Variable: 'File'=(File_Uploads)->(Get: Loop_Count)]
  <p>Path: [Output: $File->(Find: 'upload.name')]
  <br>Size: [Output: $File->(Find: 'upload.size')]
  <br>Type: [Output: $File->(Find: 'upload.type')]
  <br>Real: [Output: $File->(Find: 'upload.realname')]
[/Loop]

<p>Path: E://WinNT/Temp/Lasso-tmp1.uld
<br>Size: 32
<br>Type: image/gif
<br>Real: MyPicture.GIF