Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with WinHttp
Message
From
22/05/2008 11:02:36
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
22/05/2008 10:37:36
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01319013
Message ID:
01319021
Views:
24
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform