<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Just found this which looks like it hits the spot !<br>
<br>
<br>
<br>
var<br>
Stream : TIdMultipartFormDataStream;<br>
PostDataStream : TStringStream;<br>
begin<br>
PostDataStream := TStringStream.Create('');<br>
Stream := TIdMultipartFormDataStream.Create;<br>
try<br>
Stream.AddFile( 'XMLData', 'C:\a\Test.xml', 'text/xml' );<br>
IdHTTP1.Post('<a class="moz-txt-link-freetext" href="http://www.aaaaa.com.au/clc_UploadTest.php">http://www.aaaaa.com.au/clc_UploadTest.php</a>',
Stream, PostDataStream);<br>
ShowMessage(PostDataStream.DataString);<br>
finally<br>
PostDataStream.Free;<br>
Stream.Free;<br>
end;<br>
<br>
<br>
Which seems to work fine. However I now get a funny PHP message. But
I will take that to the offtopic section if required :)<br>
<br>
Cheers<br>
<br>
<div class="moz-signature">
<div class="Section1">
<p class="MsoNormal"><span style="color: rgb(255, 153, 0);" lang="EN-NZ"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="" lang="EN-NZ"><o:p> </o:p></span></p>
</div>
</div>
<br>
<br>
Robert martin wrote:
<blockquote cite="mid:4A076165.8020800@chreos.co.nz" type="cite">Hi all<br>
<br>
I am wanting to send an XML file I have to a PHP script for
processing. I am wanting to use TidHttp and have the following code
snippet...<br>
<br>
var<br>
sResponse: String;<br>
fsParams: TFileStream;<br>
begin<br>
fsParams := TFileStream.Create('.\test.xml', fmOpenRead or
fmShareDenyWrite);<br>
try<br>
IdHTTP.Request.ContentType := 'text/xml';<br>
sResponse :=
IdHTTP.Post('<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="https://secure.dev.gateway.gov.uk/submission">https://secure.dev.gateway.gov.uk/submission</a>',
fsParams);<br>
ShowMessage(sResponse);<br>
except<br>
on E: Exception do<br>
ShowMessage('Error encountered during POST: ' + E.Message);<br>
end;<br>
<br>
<br>
This was from a web site. Not mine !<br>
<br>
But I wonder what should happen at the PHP end. When my scripts
processes usually things usually I go 'vardata = $_REQUEST[FieldName]
to get the value. Than my XML I should do something like<br>
<br>
<br>
<code><span style="color: rgb(0, 0, 0);"><span
style="color: rgb(0, 119, 0);"><br>
</span><span style="color: rgb(0, 0, 187);">$xml </span><span
style="color: rgb(0, 119, 0);">= new </span><span
style="color: rgb(0, 0, 187);">SimpleXMLElement</span><span
style="color: rgb(0, 119, 0);">(</span><span
style="color: rgb(0, 0, 187);">$vardata</span><span
style="color: rgb(0, 119, 0);">);<br>
<br>
echo </span><span style="color: rgb(0, 0, 187);">$xml</span><span
style="color: rgb(0, 119, 0);">-></span><span
style="color: rgb(0, 0, 187);">movie</span><span
style="color: rgb(0, 119, 0);">[</span><span
style="color: rgb(0, 0, 187);">0</span><span
style="color: rgb(0, 119, 0);">]-></span><span
style="color: rgb(0, 0, 187);">plot</span><span
style="color: rgb(0, 119, 0);">; </span><span
style="color: rgb(255, 128, 0);"></span></span></code><br>
<br>
The question I have (which is Delphi related) is. My code doesn't pass
the XML file as a param (does it?) how should I do this or am I
misunderstanding.<br>
<br>
Sorry if I have not been clear enough.<br>
<br>
Thanks<br>
Rob<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: <a class="moz-txt-link-abbreviated" href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a>
Admin: <a class="moz-txt-link-freetext" href="http://delphi.org.nz/mailman/listinfo/delphi">http://delphi.org.nz/mailman/listinfo/delphi</a>
Unsubscribe: send an email to <a class="moz-txt-link-abbreviated" href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe</pre>
</blockquote>
</body>
</html>