FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
[WD21] HTTP functions. File exists?
[WD21] HTTP functions. File exists?
Débuté par GuenterP, 18 mai 2017 07:25 - 4 réponses
Connectez-vous…
GuenterP
#1
Posté le 18 mai 2017 - 07:25
Hi,
I just wanted to look whether a certain file (size between 50 - 100 Mb) is existing in a certain directory on a web server.
Ok, I know that I could use FTP functions but I'm hesitating to include FTP user / password combination in in several hundred pieces of an application. For Security reasons my customers would have to define a separate FTP-user for their servers with restricted rights .. imho this is much too complex.
So, I tried to use HTTPRequest(..) and HTTPSend(..). These functions do detect the file but are doing an immediate download at the same time. Which takes time and is not needed at all. I just want to see whether the file is existing ...
Is there any hint you could give me?
Signaler
0
0
Michael Drechsel
#2
Posté le 18 mai 2017 - 09:59
Hi,
create a webservice.
Just a awp site with the filename as a parameter. The site returns false or true if the file exist or not.
Signaler
0
0
GuenterP
#3
Posté le 18 mai 2017 - 10:10
Hi Michael,
most probably, most of our customers are using or will use their own web servers. Last year we got rid of the last customer using our web server with a HFSQL database for a dozen cash registers and I'm not eager to get any new ones onto our server.
Signaler
0
0
Jose Antonio Garrido
#4
Posté le 18 mai 2017 - 10:45
Hi,
I have litte time since I have to go in 1 min.
I made a test with WD Using Sockets.
Open it.
Replace RTFControl with Multiline Text Control.
Comment lines that added RTF content to the control.
Add SocketChangeTransmissionMode(csSocketName,SocketEndTag) afer SocketConnect(csSocketName,gnListeningPort,NetIPAddress(gfsServer))
Run the application.
Select Port 80 and Client
Select
www.windev.com
and whatever
Put this code onto the Text Control:
HEAD /img/visual/21/logo-pcsoft.png HTTP/1.1 HOST: windev.com Accept: */* User-Agent: runscope/0.1 Add another new blank line or two at the end
And, finally, press send. You will get a response back, filled in the table above, with the size of the pcsoft logo, without downloading it.
So it may be usefull to you.
Regards,
José Antonio.
Signaler
0
0
GuenterP
#5
Posté le 18 mai 2017 - 10:53
Hi Jose Antonio,
thank you for your help! I'm going to test that one!
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
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