Use this function to define realms from within your database. The XML you give this function is set up in the exact same way the UPLOADit_Realms.xml file is set up. When you define realms with this function, they are immediately available and they are added to the UPLOADit_Realms.xml file for the next time your UPLOADit server is stopped and restarted.
Use this function to delete a defined realm. You can delete any realm that has been defined either through the Upld-DefineRealmXML function, through the Configuration Dialog, or through the UPLOADit_Realms.xml file. The parameter you give this function should be the name of the realm you need to delete.
Use this function to copy one file to another location on your hard drive. This function takes two named parameters, the "src" and "dest" parameters. The "src" parameter is the full path to the file that you would like to copy. The "dest" parameter is the full path to the folder where you would like to copy the file to. (The "dest" parameter can also point to a non-existent file, and the file you are copying will be renamed as it is copied.) The "src" and "dest" parameters can be in any order, but they must be separated by a semicolon (";").
Use this function to create a folder (directory) on your hard drive. This function takes one parameter, which can be named, but does not have to be. The "folder" parameter is the full path to the non-existent folder that you would like to create. If you specify multiple sub-folders that do not exist, they will all be created. In other words, if you specify the folder "c:\this\is\a\test\", and none of the "this", "is", "a", or "test" folders exist, they will all be created.
Use this function to delete a file from your hard drive. This function takes one parameter, which can be named, but does not have to be. The "file" parameter is the full path to the existing file that you would like to delete.
Use this function to retrieve the path to the folder containing the database you specify. This function will only work for databases that are on the local machine. The parameter you give must be the file name of the database you need the path from. If you need the path of the database where your script is running, you can use the Status(CurrentFileName) function to get the file name of the database. (If you ever changed the name of your database, using the Status(CurrentFileName) function would take that into account and this function would always work as expected.)
Use this function to retrieve the path to the folder containing the FileMaker Pro application on your hard drive. This function does not take a parameter, so you can use the empty string ("").
Use this function to move one file to another location on your hard drive. This function takes two named parameters, the "src" and "dest" parameters. The "src" parameter is the full path to the file that you would like to move. The "dest" parameter is the full path to the folder where you would like to move the file to. (The "dest" parameter can also point to a non-existent file, and the file you are moving will be renamed as it is moved.) The "src" and "dest" parameters can be in any order, but they must be separated by a semicolon (";").
Use this function to rename an existing file on your hard drive. This function takes two named parameters, the "file" and "newname" parameters. The "file" parameter is the full path to the file that you would like to rename. The "newname" parameter is the new file name for the existing file. The "file" and "newname" parameters can be in any order, but they must be separated by a semicolon (";").
Use this function to get the size of a file on your hard drive. This function takes one parameter, which can be named, but does not have to be. The "file" parameter is the full path to the file that you would like to get the size of.
When a user uploads a file to your UPLOADit server, they submit a web form with their web browser. This web form can contain any number of web form fields. Use this function to get the value from any one of those form fields. The parameter you give this function should be the name of the field you need the value of. For example, if the web form contained a form field like this:
<input type="text" name="FirstName">
Then you could use this function with the parameter "FirstName" to get the value the user entered into that field in their web browser.
You also use this function to get special values about the currently connected user. Use one of the following parameter names to get that special value:
This function is only useful when a user's web browser is connected to your UPLOADit server. When a user uploads a file to your UPLOADit server, and you have defined a database and script to run when this happens, UPLOADit will call that script in your database. In the script that UPLOADit calls, you can use this function to retrieve the values from this user's web browser and then call the "Upld-ReleaseClient" function to redirect the user's web browser to its final location.
Use this function to define the TCP/IP port that you need your UPLOADit server to listen for connections on. By default, the port is set to 8080, but you can use anything in the range of 0 to 65535. There is one exception to this and that is on Mac OS X, where you cannot set the port below 1024 unless the FileMaker Pro process is running with super user privileges (something that is probably not a good idea). You must define this port before starting the server if you need it to be different than the default. (Note: If you change the port that your UPLOADit server listens for connections on, make sure you update the "action" attribute of your web form that upload files to your UPLOADit server. For more information on setting up your web form, please see the Chapter 2, "How to set up your Web Page Form", in this documentation.)
Use this function to register your copy of UPLOADit. There are two ways you can use this function. If you specify the parameter "DIALOG", the plug-in will display a dialog asking you to fill in your registration information. Alternatively, you can specify your registration information in the order "First Name", "Last Name", and "Registration Number" all separated by the pipe character ("|"; usually created by typing shift-backslash). Whenever you use this function, you will be presented with a dialog containing our License Agreement for the plug-in that asks you to accept the agreement. If you need to use this function in a startup script to register the plug-in every time the solution starts, you can auto-accept the License Agreement by adding "|I Accept the License Agreement" to the end of your registration information.
When a user uploads a file to your UPLOADit server, and you have defined a database and script to run when this happens, UPLOADit will call that script in your database. In the script that UPLOADit calls, you can retrieve the values from the form that you need, possibly set a Result URL, and then you must release the user's web browser so that it can be redirected to its final location. Use this function to do that. If you do not use this function to release the user's web browser, the user's web browser will never get redirected and will either sit there forever doing nothing, or eventually time out and tell the user that the server did not respond. This function does not take a parameter, so you can use the empty string ("").
When a user uploads a file to your UPLOADit server, and you have defined a database and script to run when this happens, UPLOADit will call that script in your database. In the script that UPLOADit calls, you can retrieve the values from the form that you need, and based on those values, you can decide if you need to redirect the user's web browser to an alternate page than what is defined in the realm or in the web form. You would then release the user's web browser to redirect it to the URL you have specified. One possible use for this feature is to validate the information the user has filled into your web form. For example, if your form asks for their name, zip code, and their resume file, and they submit the form without filling in their name field, you could redirect their web browser to an "error" page instead of the default "thank you" page that you have defined in your realm. (For more information on setting the Result URL based on form field values, please see Chapter 3, "How to set up your UPLOADit FileMaker Script".)
Use this function to start your UPLOADit server. This function first loads your realms from the UPLOADit_Realms.xml file, and then starts the server if it could successfully load the realm file. If this function has a problem loading the UPLOADit_Realms.xml file, it will report that error to your result field and not start the server. If you make changes to the UPLOADit_Realms.xml file on your hard drive, you will need to stop (using the Upld-StopServer function) and restart the server (using this function). If you make changes to the realms using the Upld-DefineRealmXML function or through the Configuration Dialog, those changes are active immediately; you do not need to stop and restart the server for those changes to take effect. (Changes made through the Upld-DefineRealmXML function or through the Configuration Dialog will be saved to your UPLOADit_Realms.xml file so that they will be retained if you do stop and restart your server, though.) This function does not take a parameter, so you can use the empty string ("").
Use this function to stop your UPLOADit server. If you make changes to your UPLOADit_Realms.xml file on your hard drive, you can use this function and then the "Upld-StartServer" function to enable your changes. This function does not take a parameter, so you can use the empty string ("").
Use this function to return the version of the UPLOADit plug-in you have loaded in FileMaker Pro.
If you will be using the Auto Plug-in Update feature of the latest versions of FileMaker Server to distribute this plug-in to FileMaker Pro client machines, you will want to use the special "AUTO UPDATE" parameter with this function. When you use the special "AUTO UPDATE" parameter with this function, it will return the version of the plug-in in a "Auto Update friendly" form that can be used with the TextToNum() calculation function in FileMaker to accurately determine if one version is newer than another. Any time that you will be working with the version of the plug-in for Auto Update purposes, you should use the "AUTO UPDATE" parameter.
You can also use this function to bring up the UPLOADit Configuration Dialog without having to go through FileMaker Pro's Application Preferences dialog. If you give this function the parameter "CONFIGURE", it will open the UPLOADit Configuration Dialog just as if you went through FileMaker Pro's Application Preferences dialog. If you give this function the parameter "ABOUT", it will open the UPLOADit Configuration Dialog, but the first tab that will be shown will be the "About" tab, which contains version and registration information for the plug-in.