AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones de descarga
  • Properties specific to DownloadParameter variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The DownloadParameter type is used to define all the advanced characteristics of a file download performed by DownloadAdd. You can define and change the characteristics of this download using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Ejemplo
// Procedure to call at the end of the download
PROCEDURE DownloadCompleted(InfoDownload is DownloadInfo)
IF InfoDownload.Status = downloadStatusSuccessful THEN
    Info(InfoDownload.Title + " has been downloaded successfully."
    RETURN False
END


// ---------------
// Create a DownloadParameter variable 
// to store the download information
ParameterDownload is DownloadParameter

// Specify the parameters of the download
ParameterDownload.Source = ...
	"https://windev.com/storage/en_US/img/visual/25/logo-pcsoft.png"
ParameterDownload.Title = "PC Soft Logo"
ParameterDownload.Description = "PC Soft company logo"
ParameterDownload.Destination = SysDirExternalStorage(1, sseAppDownload)
ParameterDownload.MobileNetworkAllowed = True
ParameterDownload.MeteredNetworkAllowed = False
ParameterDownload.RequiresCharging = True
ParameterDownload.NotificationMode = downloadNotifProgressAndCompletion
// Procedure to call at the end of the download
ParameterDownload.ProcedureEnd = "DownloadCompleted"

// The download is added to the list of downloads to be started
// (The download manager will start the download as soon as possible).
nID is int = DownloadAdd(ParameterDownload)

telInfo is DownloadInfo = DownloadGetInfo(nID)

Info(telInfo.Title)
Propiedades

Properties specific to DownloadParameter variables

The following properties can be used to handle the characteristics of a download:
Property nameType usedEffect
DescriptionCharacter stringDownload description displayed in the notification (if enabled).
Note: This property is optional.
DestinationCharacter stringPhysical address where the file will be stored. The path must correspond to:
  • the external storage of the device,
  • the folders of the application,
  • the public downloads folder, accessible by calling SysDirExternalStorage with the ssePublicDownload constant.
If no destination is specified or if this property is an empty string, the file will be downloaded to the public downloads folder.
Note: This property is optional.
HeaderArray of character stringsUsed to add a header to the download request. The following syntax must be used:
<Variable name>.HTTPHeader["Header name"] =
"Value of header"
MeteredNetworkAllowedBoolean
  • True (default) if the download can be done over a metered network. A metered network means a network that has a cost to the user, has a data limit or has performance or battery issues.
  • False otherwise.
MobileNetworkAllowedBoolean
  • True (default value) if the mobile network can be used for the download.
  • False otherwise.
NotificationModeInteger constantDownload notification mode:
  • downloadNotifNo Notification is not visible.
    Note: use of this constant requires the addition of the DOWNLOAD_WITHOUT_NOTIFICATION permission.
  • downloadProgressionNotification (Default value): As long as the download is in progress, a notification shows the progress and disappears when the download is complete.
  • downloadProgressNotificationEnd While the download is in progress, a notification shows the progress and remains visible when the download is complete.
ProcedureEndGlobal procedure onlyName of the procedure to be called at the end of the download whether it is completed or canceled:
  • If the application is not started the download is completed, the system starts the application to execute the procedure.
  • If the procedure returns True, the download will be removed and the downloaded file will be deleted.
RequiresChargingBoolean
  • True if the download requires the phone to be charging,
  • False (default value) otherwise.
RoamingAllowedBoolean
  • True (default) if data roaming can be used for the download.
  • False otherwise.
SourceURI variablehttp/https address of the file to be downloaded.
TitleCharacter stringDownload title displayed in the notification (if enabled). If this property is not specified or is an empty string (""), a default title based on the name of the downloaded file will automatically be used.
Versión mínima requerida
  • Versión 27
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local