Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with WinHttp
Message
De
22/05/2008 11:02:36
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
À
22/05/2008 10:37:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
01319013
Message ID:
01319021
Vues:
25
I just went through all this and your code looks ok to me. I'm using Microsoft.XMLHTTP instead of WinHttp.WinHttpRequest though. Do you need to authenticate before you can get access? Are you getting an error? Is there a .ResponseText property to your object? On mine, that contains what was returned from the server.


>Hi All
>
>It's the first time I use WinHttp and I try to send a file with WinHttp.WinHttpRequest to a website, they use a php script.
>
>But they dont recive the file
>What is wrong wityh my code ?
>
>This is my code
>
>lcFichier = FiletoSTR('c:\BenoitM.txt')
>WinHttpReq=Createobject("WinHttp.WinHttpRequest.5.1")
>winHttpReq.open('POST','http://***.********.**/*******/upload.php',.f.)
>winHttpReq.SetRequestHeader("Content-Type","text/html")
>winHttpReq.SetRequestHeader("Enctype","multipart/form-data")
>winHttpReq.Send(lcFichier)
>
>
>They give me a exemple in delphi
>
>procedure TFormConfirmAuto.SendFileHTTP(Fichier: String);
>var
> MultiPartFormDataStream: TIdMultiPartFormDataStream;
>begin
> MultiPartFormDataStream := TIdMultiPartFormDataStream.Create;
> try
> //"Joint" le fichier
> MultiPartFormDataStream.AddFile('userfile', Fichier, 'multipart/form-data');
> MultiPartFormDataStream.Position := 0;
> //Post !
> IdHTTP1.Post('****://***.********.**/*******/upload.php', MultiPartFormDataStream);
> finally
> MultiPartFormDataStream.Free;
>end;
>
>Thanks for any tips
>
>
>Benoit
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform