|
|
|
|
|
Saves, in the background, the content of a resource (image, text, etc.) identified by its URI in an external file. Sintaxis
URIToFile(<URI> , <Path> , <Procedure> [, <MIME type>])
<URI>: URI or character string variable URI or character string variable that identifies the resource to save. <Path>: Character string Corresponds to:- a directory path (this directory must exist): the resource will be saved in this directory. The name of the created file will correspond to the original name of the resource, and its extension will depend on the format used to save it (see notes).
- A full or relative file path. If the file already exists, it will be overwritten.
Caution: the file extension will not be modified even if the resource had to be converted to another format to be saved.
The full path of the saved file will be passed as a parameter of the procedure called once the save has been completed. <Procedure>: Name of the WLanguage procedure Name of the WLanguage procedure ("callback") called once the save has been completed. This procedure has the following format:
PROCEDURE <Nom de la procédure>(<Résultat>, <Chemin>) where: - <Result> is boolean:
- True if the save has been completed,
- False otherwise. To get more details on the error, use ErrorInfo before any other call to a WLanguage function (this would reinitialize the error).
- <Path> is a character string that corresponds to the full file path used for saving.
<MIME type>: Optional character string MIME type corresponding to the format in which the resource must be saved (see Notes). If this parameter is not specified or corresponds to an empty string (""), the resource will be saved in its original format if possible or it will first be converted to a default format. Observaciones - To select a resource and get its URI, use URISelect.
- When the resource to save does not come from the device's file system, the content provider that manages the resource may need to convert this resource. This is usually the case if no application on the device can manage the original format of the resource. It is possible to specify the conversion format of the resource by entering the parameter <MIME type>. To find out the MIME type into which a resource can be converted, use URIGetInfo with the constant uriInfoConversionType. If this function returns an empty string (""), the resource cannot be saved. In this case, do not call URIToFile on this resource, since it will fail.
Example: a Microsoft Word file (.doc or.docx) is selected using URISelect. This file is on Google Drive and no application on the device can handle this type of document. When saving this resource, the content provider will automatically convert this resource to PDF format. In this case, URIGetInfo used with the constant uriInfoConversionType will return the following string: "application/pdf + TAB + .pdf".
Componente: wd300android.aar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|