Effector 6.3 developer manual

XML reference 6.3

Effector Studio 6.3 summary

Effector Studio 6.3 manual

Effector 6.2 developer manual

XML reference 6.0

Effector Studio 3.2 summary

Effector Studio 3.2 manual

FileInterface

Downloading, uploading and displaying files is done by the FileInterface function.

The downloading and displaying functions are done by direct instead of indirect referencing . It is possible to define an expiration time for these references. All access is logged by the system.

The indirect references are stored by the system in the FSYS_FileInterface table. The use of the indirect references (access log) is stored by the FSYS_FileInterfaceLog table.

Uploading

Executes the file upload function of the document type fields. Basically, file uploading is done through the FileInterface?a=upload URL instead of the FileUpload.aspx URL. File upload is possible only with a logged in user.

Download

The URL has a FileInterface?p=<<PUBLICID>>&a=download format, where PUBLICID is the identifier generated by the FileInterface.

Example in DataDefiniton:

<Column name="FileInterfaceID">
    <UseFileInterface>true</UseFileInterface>
    <Definition>
        CAST(d.DocumentID  AS VARCHAR(20)) as FileInterfaceID
    </Definition>
    <IdColumn>DocumentID</IdColumn>
    <OutFilter type="Param">
        <Alias>FileInterfaceID</Alias>
    </OutFilter>
</Column>
<Column name="FileLink">
    <IsComposite>true</IsComposite>
    <Definition>
         <![CDATA[
            '<a href="FileInterface?p=[##Column.FileInterfaceID##]&a=download" target="_blank">' +  ISNULL(d.RenamedFilename,'') + </a>' AS FileLink
        ]]>
    </Definition>
    <IdColumn>DocumentID</IdColumn>
</Column>

Display

The URL has a FileInterface?p=<<PUBLICID>>&a=display format, where the PUBLICID means the identifier generated by the FileInterface.

This enables not only the display of the files in the Document table, but it is also possible to display any file in the system (that is still regulated by the urlfilter.xml.)

Example in EmbeddedWebDisplay:

<URL type="Constant" return="string" default="">
    <![CDATA[
        FileInterface?p=[##Filter.FileInterfaceID##]&a=display
    ]]>
</URL>

Changes in the DLL

Example

retVal.RedirectTarget = “_blank”;
object publicID = dataProvider.CreateFileInterfaceReference(fileName);
retVal.RedirectURL = string.Format(“/FileInterface?p={0}&a=download”, publicID);

XML configuration

In order to download a file, we have to create the indirect reference to it. If we create an indirect reference to an int type field, the system will assume that the document needs to be taken from the document table.

The creation of the indirect reference is done by setting the value of the Column/UseFileInterface node of the DataDefinition to true. Here, the Effector creates an indirect reference for all the rows using the value in the column. This does not make the document ready for download. Another column needs to be created in which the download link is assembled.

*Example

<Column name="FileInterfaceID">
    <UseFileInterface>true</UseFileInterface>
    <Definition><![CDATA[CAST(d.DocumentID  AS VARCHAR(20)) as FileInterfaceID]]></Definition>
    <IdColumn>DocumentID</IdColumn>
    <OutFilter>
        <Type>Param</Type>
        <Alias>FileInterfaceID</Alias>
    </OutFilter>
</Column>
<Column name="FileLink">
    <IsComposite>true</IsComposite>
    <Definition><![CDATA['<a href="FileInterface?p=[##Column.FileInterfaceID##]&a=download" target="_blank">' + ISNULL(d.RenamedFilename,'') + '</a>' AS FileLink]]></Definition>
    <IdColumn>DocumentID</IdColumn>
</Column>

The FileInterfaceID column contains the generated indirect reference, while the “FileLink” column contains the link made for the download. The other novelty brought by this development is the so called Composite column. The IsComposit node’s true value signals to the system that the function is switched on and in such a case, after querying the column’s value, the [##Column.##] references will be replaced with the value of the columns in the given row.

  • Last update: 2 weeks 5 days ago
  • Effector