User:anonymousLog inRegister
Recents:
FileType runtime property
Blobs - FileType runtime property

You can use it to retrieve the file extension of a blob; or to change it, dinamically.

Retrieving the extension of the file

Use the following sintax:

&extension = Attblob.FileType

The FileType property returns the actual file extension, when the blob is being uploaded.
For instance, if you have the following rule in a web transaction:

msg('The uploaded file is ' + Attblob.FileName + '.' + Attblob.FileType) if not Attblob.isempty() on aftervalidate;

When uploading the file, Attblob.FileType returns the actual file extension.
When the file is being downloaded, the FileType is obtained from:

1. The FileType property, if it´s assigned in the design model.
2. The FileTypeAttribute property of the blob (if it has one).

Otherwise, it returns null.

Example:

Suppose you have a blob in the web form, and you want to capture the blob extension, when downloading it, so you have:

Event Load

&FileType = Attblob.FileType

EndEvent  // Load


Changing the extension dinamically

 
Attblob.FileType = <extension>

You can change the extension of a file, at the moment of downloading it. This is the main purpose of the FileType runtime property.
It´s goal is to change the extension that the temporary file is going to be saved with.

Example:

You have a blob attribute that hasn´t got a FileTypeAttribute associated to it. You want to assign to it the .doc extension, at the moment of downloading it, so you have:

Event Start

    Attblob.FileType = 'DOC'

EndEvent  // Start

 
Important Note:  The value of this property is ignored if the File Type Attribute property is set.
Created: 09/07/06 02:30 PM by sjuarez Last update: 09/07/06 02:32 PM by sjuarez
 
Page
Categories
Group
 
Powered by GXwiki 3.0 (generated with GeneXus X Evolution 1 U3)