Salesforce

ClientFileOpenDlg (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

ClientFileOpenDlg (Magic xpa 3.x)

Opens a Windows Open File dialog box and returns the selected files. For mobile devices, this function can be used to get an image file using the camera or from the pictures gallery.

Syntax:

ClientFileOpenDlg (title, initial path, filter, check file exists, multi select)

Parameters:

title – The window title text.

initial path – The name of the initial path. This path will also accept the filename and show it in the dialog box. A blank value will use the last path chosen.
(Before version 1.9, this was: initial directory – The name and path of the initial directory. A blank value will use the last directory chosen.)

filter – string. The filter string contains a description of the filter, followed by the vertical bar (|) and the filter pattern. The strings for different filtering options are separated by the vertical bar. Several filter patterns can be joined to a filter by separating the file types with semicolons. The first pair will be the default in the dialog box.

For example: 'Image Files (*.BMP;*.JPG;*.GIF) | *.BMP;*.JPG;*.GIF|All files (*.*)|*.*'

check file exists – This is a Logical type parameter that determines whether a warning message will be displayed if the user specifies a file name that does not exist.

multi select – This is a Logical type parameter that determines whether the dialog box supports multiple selections of files. In case this is True, the function will return those names delimited by a pipe ("|").

Returns:

Returns the selected files.

Examples:

ClientFileOpenDlg ('Open file', 'c:\temp\', 'All files (*.*)|*.*', 'FALSE'LOG, 'FALSE'LOG) – Opens a File Open dialog box with default of C:\temp and the filter will show all files.

ClientFileOpenDlg ('Open file', 'c:\temp\', 'Image Files (*.BMP;*.JPG;*.GIF) | *.BMP;*.JPG;*.GIF|All files (*.*)|*.*', 'TRUE'LOG, 'FALSE'LOG) – Opens a File Open dialog box with default of C:\temp and different filters. The file dialog box will prompt if the file does not exist.

ClientFileOpenDlg ('Open file', 'c:\temp\', 'All files (*.*)|*.*', 'FALSE'LOG, 'TRUE'LOG) – Opens a File Open dialog box with default of C:\temp and the filter will show all files. Multiple file selection is allowed.

ClientFileOpenDlg ('Open file', 'c:\temp\abc.txt', 'All files (*.*)|*.*', 'FALSE'LOG, 'FALSE'LOG) – Opens a File Open dialog box with default file name of abc.txt and default path of C:\temp, and the filter will show all files.

ClientFileOpenDlg (' ', 'camera', ' ', 'TRUE'LOG, 'FALSE'LOG) – Acquires an image file using the camera from the Android, iOS or Windows 10 Mobile client.

ClientFileOpenDlg (' ', 'images', ' ', 'TRUE'LOG, 'FALSE'LOG) – Acquires an image file using the pictures gallery from the Android, iOS or Windows 10 Mobile client.

Note:

This is a client-side function that is only available for Rich Client tasks.

Platform specific:

Note: The following functionality is deprecated; but will continue to run if used in a program. Instead of this function, use the ClientImageCapture function to capture an image. (Since version: 3.2a)

You can get an image file using a camera or from the image gallery from the Android, iOS and Windows 10 Mobile client using the ClientFileOpenDlg function by specifying the following value in the initial path value (2nd parameter):

  • camera – the camera will be opened. Note: The camera value cannot be used to capture videos. Since version: 3.0

  • images – the images (gallery) will be opened.

The full path name of the picture will be returned from the function. It is then possible to upload this picture to the server using the ClientFileToServer function, or by loading it into a BLOB variable.

The function will copy the selected image into a temporary file in the application cache folder. Until V3.2a, on Android devices, the function returned the image path from the gallery.

Since version: Android and iOS support – 2.2a

See also:

The Rich Client Samples project (REL15b, REL16b and REL17b)

Since version:

1.5

Reference
Attachment 
Attachment