There are many predefined methods defined by Cache under Security.* package to maintain/manage Roles/Users/Resources ...ect.

Specific to your query, you can use below command to export/import Roles:

Write ##class(Security.Roles).Export("C:\RolesExport.xml")
Write ##class(Security.Roles).Import("C:\RolesExport.xml")

Roles: 
Please refer to below class doc for more: http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25sys&CLASSNAME=Security.Roles&CSPCHD=000000000000gt0xiwWBxf8D77QROEE$c2JR50xdHrcUuUzSzc&CSPSHARE=1

Resources:
http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25sys&CLASSNAME=Security.Roles&CSPCHD=000000000000gt0xiwWBxf8D77QROEE$c2JR50xdHrcUuUzSzc&CSPSHARE=1

Property UniqueStringValue As %String(COLLATION = "SQLUPPER");
Index ValueIndex On UniqueStringValue [ Unique ];

Use COLLATION as above, to specify the manner in which property values are transformed for indexing.

Below is how data and index will look like,

ZW ^DataGlobal
^DataGlobal=1
^DataGlobal(1)=$lb("",,"Hello")
 
ZW ^IndexGlobal
^IndexGlobal("NameIDX"," HELLO",1)=""
^IndexGlobal("ValueIndex"," HELLO",1)=""

Test:

Write ##class(Package.Data).ValueIndexExists("hello") = 1
Write ##class(Package.Data).ValueIndexExists("HELLO") = 1
Write ##class(Package.Data).ValueIndexExists("heLLO") = 1
Write ##class(Package.Data).ValueIndexExists("hello") = 1
Write ##class(Package.Data).ValueIndexExists("Hello") = 1
Write ##class(Package.Data).ValueIndexExists("HelloGuys") = 0

ISC DocBook: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_basics#GSQL_basics_collation

I believe you have figured out the solution for this.

I have just mentioned below list of methods for different fields.

NAME - Name()
SSN - SSN()
COMPANY - Company()
TITLE - Title()
PHONE - USPhone()
CITY - City()
STREET - Street()
ZIP - USZip()
MISSION - Mission()
STATE - USState()
COLOR - Color()
PRODUCT - Product()

DocBook Link:
docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_populate

I would suggest to use client side javascript API to check the file size, instead of uploading it to server and check it.

I got a nice article on a blog.

<script language='JavaScript'> 
function checkFileSize(inputFile) {
        var max = 3 * 512 * 512; 
        if (inputFile.files && inputFile.files[0].size > max) { 
                alert("File is too large to upload."); 
                inputFile.value = null; 
        } 
} </script>

Another text from DocBook, that will help you.

GETDATE returns the current local date and time as a TIMESTAMP. All Caché SQL timestamp, date, and time functions except GETUTCDATE are specific to the local time zone setting. GETUTCDATE returns the current UTC (universal) date and time as a TIMESTAMP. You can also use the Caché ObjectScript $ZTIMESTAMP special variable to get a current timestamp that is universal (independent of time zone).