FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 27
→
Downloading a .jpg to a directory without using a imageControl
Downloading a .jpg to a directory without using a imageControl
Débuté par Stephan Wiestner, 06 oct. 2022 13:23 - 2 réponses
Connectez-vous…
Stephan Wiestner
#1
Membre enregistré
10 messages
Posté le 06 octobre 2022 - 13:23
Hello
Sorry guys, I'm running in circles.
All i want is
downloading in WD "
]https://image.tmdb.org/t/p/original//85zUipgVy2QbvAJ6djZXYaGckMv.jpg
to c:\images\mypicture.jpg
If i assign it to an imagecontrol on a window and later save the control it works,
but i'm looking for a direct way.
I tried with a variable type image: doesn't work
with dsavejpg: doesn't work
with dloadimage: doesn't work
and even fcopy doesn't work
Any help, pls?
Thx so much for it
Signaler
0
0
Joris
#2
Posté le 06 octobre 2022 - 13:42
Hi Stephan,
This should work :
lsURL
is string
=
"https://image.tmdb.org/t/p/original//85zUipgVy2QbvAJ6djZXYaGckMv.jpg"
LBuffer
is
Buffer
LsDestinationFile
is string
=
"c:\images\mypicture.jpg"
IF
NOT
httpRequest
(
lsURL
)
THEN
Error
(
ErrorInfo
)
RETURN
END
LBuffer
=
HTTPGetResult
(
httpResult
)
IF
NOT
fMakeDir
(
fExtractPath
(
LsDestinationFile
,
fDirectory
+
fDrive
)
)
THEN
Error
(
ErrorInfo
)
RETURN
END
IF
NOT
fSaveBuffer
(
LsDestinationFile
,
LBuffer
)
_OR_ NOT
fFileExist
(
LsDestinationFile
)
THEN
Error
(
"Impossible to save file '"
+
lsURL
+
"' as '"
+
LsDestinationFile
+
"'."
,
ErrorInfo
)
RETURN
END
Info
(
"download done."
)
Kind regards
Joris
Signaler
0
0
Stephan Wiestner
#3
Membre enregistré
10 messages
Posté le 06 octobre 2022 - 18:46
Thx Joris! You are a genious! Works like a charm Thx again!
Signaler
0
0
→ Revenir à WINDEV 27
WINDEV 27
WEBDEV 27
WINDEV Mobile 27
WINDEV (précédentes versions)
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