473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP script to RECEIVE XML documents?

I am wondering what the best way is to have my Apache/PHP server accept an XML file that is sent using an ASP Send function. My client is using ASP to send a .5 to 2MB XML string, which I must accept and save to disk.

I have built the webpages to do this with user interaction (ie: click to add a file, and upload by clicking submit), but I am stumped on how to do this through an automated means. I must be missing something really simple. Any thoughts? Cheers!


'-------- ASP CODE THAT SENDS TO OUR PHP SERVER... --------

' *** Set up a command to send an XML file to a remove server ***
' *** - Includes MP3 file Base64 encoded

RawDir=Server.MapPath("/UserContent/" & NMD("CampaignID")) & "\Voice\"
RS.Open "SELECT * FROM UserContent WHERE ContentID=" & ContentID ,
objApp.DB,adOpenStatic,adLockOptimistic,adCmdText

' *** Create XML object ***
Set objXMLDoc = Server.CreateObject("Msxml2.DOMDocument.3.0")
objXMLDoc.loadXML "<InstallVoice />"

Set oRoot = objXMLDoc.documentElement

' *** Set up a bunch of elements here ..
/ 8< snip 8<

' *** Read the file into the stream ***
Set oRoot = objXMLDoc.documentElement
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile RawDir & RS("UploadFile")

' *** Do base64 encoding for an MP3 file ***
Set oElement = objXMLDoc.createElement("FileContents")
oElement.dataType = "bin.base64"
oElement.nodeTypedValue = objStream.Read
oRoot.appendChild oElement

Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", "http//myhostsomewhere.com/uploader.php", false

' *** Send the file up ***
xmlhttp.send objXMLDoc.XML

' *** Close down the effort....
May 3 '07 #1
1 3970
code green
1,726 Expert 1GB
If the file exists and is accesible, then you can open, read, write to the file using PHP file functions from a sript running on a scheduled task.
May 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: **** KiteOregon **** | last post by:
I need to send & receive XML Document Objects via the Message Queue. We have several applications that insert XML Document Object into the message queue. This works with no problem. I am trying...
1
by: malborg | last post by:
I have simple form in PHP with two input types as text to input login name and password.PS: They use POST method. (index.php) The other script(logowanie.php) checks if login and password is...
6
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg)...
6
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something...
2
by: Richard A. Wells | last post by:
All I wanted to do was implement a web service where I'd receive an XML document and return one in response. I'd already figured out how to use XmlReader and XmlWriter classes to do the XML work I...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
6
by: tatamata | last post by:
Hello. How can I run some Python script within C# program? Thanks, Zlatko
2
by: SMH | last post by:
I am in the process of converting all HTML documents, including many dynamic/interactive documents, to XHTML documents (because I want to incorporate SVG and MathML, among other things). I am...
2
chunk1978
by: chunk1978 | last post by:
i wrote a custom PHP script last year and everything worked perfectly... recently my webserver upgraded to PHP 5 and now my script doesn't work properly. what the script does is: users fill out...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.