Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XML file uploading

XML file uploading

Scheduled Pinned Locked Moved XML / XSL
comsysadminxmltutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Milind Panchal
    wrote on last edited by
    #1

    Hi, I have a following client side code how to upload xml file to server programatically. // files upload function function btn_send.onclick() { // create ADO-stream Object var ado_stream = new ActiveXObject("ADODB.Stream"); // create XML document with default header and primary node var xml_dom = new ActiveXObject("MSXML2.DOMDocument"); xml_dom.loadXML(' '); // specify namespaces datatypes xml_dom.documentElement.setAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes"); // create a new node and set binary content var l_node1 = xml_dom.createElement("file1"); l_node1.dataType = "bin.base64"; // open stream object and read source file ado_stream.Type = 1; // 1=adTypeBinary ado_stream.Open(); ado_stream.LoadFromFile("c:\\tmp\\myfile.doc"); // store file content into XML node l_node1.nodeTypedValue = ado_stream.Read(-1); // -1=adReadAll ado_stream.Close(); xml_dom.documentElement.appendChild(l_node1); // we can create more XML nodes for multiple file upload // send XML documento to Web server var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("POST","./default.aspx",false); xmlhttp.send(xml_dom); // show server message in message-area div_message.innerHTML = xmlhttp.ResponseText; }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups