FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 25
→
EXEMPLO DE DOWNLOAD DE ARQUIVO
EXEMPLO DE DOWNLOAD DE ARQUIVO
Débuté par adrianoboller, 28 fév. 2015 02:32 - 4 réponses
Connectez-vous…
adrianoboller
#1
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 28 février 2015 - 02:32
//EXEMPLO DE DOWNLOAD DE ARQUIVO
//##################################
Ok is
boolean
=
HTTPRequest
(
"http://www.7-zip.org/downloads.sourceforge.net/sevenzip/7z920.exe"
)
IF
Ok
=
True
THEN
ArchivoDownloading is Buffer
=
HTTPGetResult
(
)
Ok
=
fSaveBuffer
(
"/mnt/sdcard/7z920.EXE"
,
ArchivoDownloading
)
Okarchivo is
boolean
=
fFileExist
(
"/mnt/sdcard/7z920.EXE"
)
IF
Ok
=
True
AND
Okarchivo
=
True
Info
(
"Download efetuado com sucesso!'"
)
ELSE
Error
(
"Não foi possivel efetuar o download."
)
END
ELSE
Error
(
"Não foi possivel efetuar o download."
)
END
Signaler
0
0
adrianoboller
#2
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 28 février 2015 - 13:05
Dica:
Para saber o tamanho do arquivo que vai ser salvo, use o comando Length( ) na variavel do buffer descarregado.
Signaler
0
0
adrianoboller
#3
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 28 février 2015 - 14:34
Outro metodo de fazer:
Executando o download e colocando um progress bar para ver o download do arquivo:
HTTPProgressBar
(
PROGBAR_
download
)
arquivo is
boolean
=
HTTPRequest
(
"http://www.amarildomatos.com.br/clientes_arquivos/dll262.zip"
)
HTTPProgressBar
(
""
)
Signaler
0
0
amarildo
#4
Membre enregistré
535 messages
Popularité : +14 (14 votes)
Posté le 28 février 2015 - 20:49
http://windevdesenvolvimento.blogspot.com.br/2015/02/exemplo-de-download-de-arquivo.html
Nesse video vou mostrar o exemplo feito pelo adriano
Procedure
gerencie_projeto
(
TotalByte
,
TotalTransmitted
)
Trace
(
"Baixando Arquivo : "
+
TotalTransmitted
+
" / "
+
TotalByte
)
HTTPProgressBar
(
"gerencie_projeto"
)
Event
(
gerencie_projeto
,
"*.*"
,
"HTTPProgress"
)
_arquivo is
boolean
=
HTTPRequest
(
"http://www.amarildomatos.com.br/clientes_arquivos/dll262.zip"
)
HTTPProgressBar
(
""
)
IF
_arquivo
=
True
THEN
_baixar_arquivo is Buffer
=
HTTPGetResult
(
)
_arquivo
=
fSaveBuffer
(
"e:\aleva\dll262.zip"
,
_baixar_arquivo
)
_arquivo_existe is
boolean
=
fFileExist
(
"e:\aleva\dll262.zip"
)
IF
_arquivo
=
True
AND
_arquivo_existe
=
True
Info
(
"Download efetuado com sucesso!'"
)
ELSE
Error
(
"Não foi possivel efetuar o download."
)
END
ELSE
Error
(
"Não foi possivel efetuar o download."
)
END
Signaler
1
0
Luiz Alfredo
#5
Posté le 04 mars 2015 - 13:48
Agradecimentos ao Adriano e Amarildo.
Signaler
1
0
→ Revenir à WINDEV 25
WINDEV 25
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte