Defining extensions for upload type fields

Defining extensions for upload type fields

In ScriptCase, when we define a field as upload type in a Form, it is extremely important to define the Extensions allowed for this field.

This setting makes these fields accept only as installation in the configuration, prevented or uploading unwanted files.

List of upload type fields:
- Image (File Name);
- Image (Database);
- Document (File Name);
- Document (Database)

For that, we will see below how to define and configure these extensions in a very simple way, to guarantee more security for the applications developed in ScriptCase:

1 - In the Form application, go to the left side menu of this application, more precisely in the option "Fields -> Your Field", and then choose the field type, which can be any of the 4 (four) mentioned above:



2 - Once that is done, the screen will open with all the possible configurations to be carried out in the field. We are interested in the "Extensions and upload size" option, as shown in the image below:


3 - When defining the extents, it is also possible to add a maximum size for each of them, using the following units: bytes, KB, MB or GB.

Multiple extensions can be defined by clicking the Add Extension button or entering a list separated by ' ; '. For example: jpeg;png;gif


OR


4 - Once that is done, just click on "Save application", generate its source code, and run it to test the new rules defined for this field.


If you already have your application in production and have not defined the extensions for the Image and Document fields cited at the beginning of this article, just define it following the entire step-by-step above, and then publish only this application again, so that it can be safe and free of uploads of files of any kind.






    • Related Articles

    • PHP extensions

      In php.ini there is the following extensions: If you would like to use one of those extension, for example MySQL, do the following: Remove the character ";" at the beginning of the extension Ex: extension = php_mysql.dll Save the file and restart the ...
    • Dividing fields into blocks

      In a block we can separate in a previously organized way the fields that belong to the Form. In this style of organization, we can create several blocks and give the Form a more flexible and pleasant layout for the end user. For you to create a block ...
    • Hide certain fields in a Grid by means of various conditions

      When you need to hide fields through various conditions within the Grid, we can do it through a query. The first thing we are going to do is a query and we will store it inside a variable. Then we use the macro sc_lookup. After using said macro, we ...
    • CEP Type Field

      This feature is only available for Brazilian scriptcase installations
    • Installing Scriptcase with PHP 7.3 on Windows

      This documentation will walk you through the steps necessary to install PHP 7.3, Apache 2.4, and Scriptcase manually. When performing this type of installation, you are responsible for configuring your entire environment as well as database ...