Skip To Content

INTEGRAL

INTEGRAL DSL Reference Guide

Jump directly to: 

::my.app.GetPostVar_FileType(string, default_val = "")

This function returns the MIME (external page) file type associated with the requested POST variable.

Parameters

string

A string containing the name of the POST variable whose file type is to be returned.

default_val

A string containing the default file type.

Return Value

The function returns a string containing the file type of the requested variable, if that variable is found in the POST payload and its input type is “file”. If the variable is not found in the POST payload, its input type is not “file”, or the payload is not in “multipart/form-data” format, the function returns default_val.

Note

This function is intended to handle web form submissions that are in “multipart/form-data (external page)” format. While it's not illegal to call this function in other contexts, doing so will only return default_val.

Example 1

local image_file_type = ::my.app.GetPostVar_FileType("bin_image_file", "image/png");