VBScript
This function uploads a given file into the database, more precisely into the USER scope of the current script user.
Dim nResult Dim sFilePath, nFileCategory, sFileName, sDescription, bOverWrite, bCompress sFilePath = "C:\Announcements\" nFileCategory = PBXFileFileCategoryAnnouncements sFileName = "MyAnnouncement.wav" sDescription = "my regular announcement" bOverWrite = True bCompress = False nResult = PBXUser.UploadFile( _ sFilePath, _ nFileCategory, _ sFileName, _ sDescription, _ bOverWrite, _ bCompress)
This function returns S_OK in case the file was uploaded successfully, or E_FAIL in case of a problem. The script should end immediately when getting anything else than S_OK.
The function takes the following parameters:
-
sFilePath (string value) - Name of the local file (incl. path) which should be uploaded. During the upload it is possible to store the file under a different name in the database. In this case use the sFileName parameter to set that new name.
-
nFileCategory (integer value) - One of the following constants/values which define what kind of file this is:
PBXFileFileCategoryRingTones = 0 PBXFileFileCategoryCallRoutingScripts = 1 PBXFileFileCategoryBitmaps = 2 PBXFileFileCategoryAnnouncements = 3 PBXFileFileCategoryHoldMusic = 4 PBXFileFileCategorySkins = 8
-
sFileName (string value) - Name the uploaded file should be stored under in database. If you want to keep the original name of the file (as given in the sFilePath parameter), leave this parameter empty.
-
sDescription (string value) - Short description of this file. Will be displayed in the files list which can be opened on the "Files" tab within the server properties in the SwyxWare Administration.
-
bOverWrite (boolean value) - If True, an existing file with the same name in the USER scope will be overwritten. If False, an existing file with the same name in the USER scope will not be overwritten and the function will do nothing.
- bCompress (boolean value) - If True, the uploaded file will be stored compressed in the SwyxWare database. If False, the uploaded file will be store uncompressed in the SwyxWare database.
By Tom Wellige