ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Mobile specific functions / Download functions
  • Properties specific to DownloadInfo variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The DownloadInfo type is used to read the different details about a download in progress retrieved by DownloadGetInfo. The characteristics of this download can be identified and modified 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.
Example
// Procédure à appeler en fin de téléchargement
PROCEDURE FinDeTéléchargement(InfoTéléchargement is TéléchargementInfo)
IF InfoTéléchargement.Etat = downloadStatusSuccessful THEN
    Info("Le téléchargement " + InfoTéléchargement.Titre + " est terminé."
    RETURN False
END


// ---------------
// Crée une variable de type TéléchargementParamètre 
// pour enregistrer les informations du téléchargement
ParamètreTéléchargement is TéléchargementParamètre

// Spécifie les paramètres du téléchargement
ParamètreTéléchargement.Source = ...
	"https://www.pcsoft.fr/img/visuels/download.php?filename=pcsoft/logo-pcsoft.png"
ParamètreTéléchargement.Titre = "Logo PC Soft"
ParamètreTéléchargement.Description = "Logo de l'entreprise PC Soft."
ParamètreTéléchargement.Destination = SysDirExternalStorage(1, sseAppDownload)
ParamètreTéléchargement.RéseauMobileAutorisé = True
ParamètreTéléchargement.RéseauRestreintAutorisé = False
ParamètreTéléchargement.EnCharge = True
ParamètreTéléchargement.ModeNotification = downloadNotifProgressAndCompletion
// Procédure à appeler en fin de téléchargement
ParamètreTéléchargement.ProcédureFin = "FinDeTéléchargement"

// Le téléchargement est ajouté à la liste des téléchargements à effectuer
// (Le téléchargement commencera dès que le gestionnaire de téléchargement pourra le lancer).
nID is int = DownloadAdd(ParamètreTéléchargement)

telInfo is TéléchargementInfo = DownloadGetInfo(nID)

Info(telInfo.Titre)
Properties

Properties specific to DownloadInfo variables

The following properties can be used to get the details of a download:
Property nameType usedEffect
DescriptionCharacter stringDownload description displayed in the notification (if enabled).
DestinationURI variablePhysical address where the file will be stored.
FileSize8-byte integerFile size in bytes.
IdentifierIntegerIdentifier of the download in the download manager.
Progress8-byte integerNumber of bytes downloaded.
SourceURI variablehttp/https address of the file being downloaded.
StatusInteger constantDownload status:
  • downloadStatusFailed: Download failed. The StatusDetails property can be used to get more details.
  • downloadPendingStatus: Download pending.
  • downloadStatus: Download in progress.
  • downloadStatusPause: Download is paused. The StatusDetails property can be used to get more details.
  • downloadStatusSuccess: Download successful.
StatusDetailsIntegerStatus details.
If the Status property is set to downloadStatusFailed, the StatusDetails property can be used to get the RFC 2616 error code, if it was received.
Otherwise, it will correspond to one of the following constants:
  • downloadErrorInsufficientSpace: Storage space is insufficient.
  • downloadErrorExistingFile The URI points to an existing file.
  • downloadErrorUnknown The error is not known.
  • downloadStorageError: Storage error.
  • downloadPauseWaitNewTest The reason for the pause is a network error; the system waits before trying again.
  • downloadPauseWaitingForWifi: The reason for the pause is to wait for a WIFI network.
  • downloadPauseWaitNetwork The reason for the pause is to wait for a network connection.
  • téléchargementPauseInconnu: The reason for the pause is unknown.
TitleCharacter stringDownload title displayed in the notification (if enabled).
Related Examples:
Android Downloads Android (WINDEV Mobile): Android Downloads
[ + ] This example illustrates background downloads in WINDEV Mobile and Android.
It is no longer necessary to keep the application open to propose the download of a file. The download manager allows you to download large files and to notify the application when the downloads are finished.
Minimum version required
  • Version 27
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help