DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Ajax & Javascript
Reload this Page XMLHTTPRequest Object POST
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Feb 2009
Post XMLHTTPRequest Object POST - 02-24-2009, 04:25 PM

Hello -
Trying to get an XML file written to a server from the client using the XMLHTTPRequest Object. As much as I can make out, the following code should work:

//Open file
xmlDocName = "uicfg.xml";
openXMLdoc(xmlDocName);

//Modify XML content
var xDoc=gXmlDoc.getElementsByTagName("PRESETS");
xDoc[0].getElementsByTagName("NAME1")[0].childNodes[0].nodeValue = document.getElementById("prePosName1").value

//XMLHTTPRequest connection - send file
var request = new ActiveXObject("Microsoft.XMLHTTP");
request.open("POST","./uicfg.xml",true);
request.onreadystatechange = function(){qwerty(request)};
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
request.send(gXmlDoc);

The script modifies the XML content before writing it back to the server. I verified that those node changes seem to take by re-reading the modified node and displaying it in a test box.

The XMLHTTPRequest Object status comes back (in the qwerty function) as 200 indicating the server is happy to take the file (???). But the original file on the server remains unchanged.

The server is a bare bones server that doesn't have stuff like ASP or PHP or anything that I can personally write a handler for. And I don't know how to make a CGI script for it. So I'm sorta screwed that way. I'm using the XMLHTTPRequest object stuff on this web server to control a web cam so I know the AJAX stuff works (using GET).

Does anyone know how to properly send a file via AJAX like this so that the file simply gets written to the specified server file location?

Thanks for any help in advance...
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 11
Thanks: 0
Thanked 3 Times in 3 Posts
Join Date: Jan 2009
Default 05-06-2009, 12:43 PM

This is not an Ajax (not an acronym) question. Whether you can or cannot do this sort of thing has little to do with the browser side of your application (although true implementations of this will likely have some browser-side components). Typically, this is what "WebDAV" is for, which will take work to implement.
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: May 2009
Location: Taipei
Send a message via MSN to Ovda8aO
Default 06-07-2009, 01:28 AM

Good afternoom , I learns Germany of behavior . Gerar? Fata! To teacher a wonder gifts and fans.The manifest of Microsoft XML document one.Windows frame C program will do the one of XML .Tag name is PRESENTS.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
jobs post: www.techiecrossing.com ethquake IT News & Events 2 09-07-2009 12:40 AM
how to send object using j2me jay_goh Java 2 02-04-2009 09:08 PM
library for dumping object content via reflection denis.tsyplakov Java 2 08-28-2008 06:13 AM
NullPointerException getting with org.eclipse.swt.ole.win32.OleAutomation Object gnaru Zones 0 06-03-2008 07:52 AM
Post icon labels don't match glennji Feedback 0 02-15-2008 10:01 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com