<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    javascript post mothed

    Hi I am currently re-developing a web based front end for an estate agent to manage their propertys. I have decided to use a Microsoft.XMLHTTP object to communicate between the client and server. My problem is got to do with sending a file with this. The client is composed of the usual GUI components which the data can be easily retrieved from for sending to the server but it also contains a file element for selecting a picture of the property to be uploaded. How do I get the data from this so that it can be uploaded to the server using the Microsoft.XMLHTTP object. I have found a bit of code on the net but it is no use to me because it would involve changing the security in "Internet Options" which I have no control over.

    <HTML>
    <HEAD><TITLE>File Send</TITLE></HEAD>
    <BODY>
       
    <INPUT id=btn_send name="btn_send" type=button value="FILE SEND">
       
    <DIV id=div_message>Ready</DIV>
    </BODY>
    </HTML>

    <SCRIPT LANGUAGE=JavaScript>

    // 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('
    <?xml version="1.0" ?> <root/>');
       
    // 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:\\sold.gif");
       
    // 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","http://www.google.com",false);
       xmlhttp.send(xml_dom);
       
    // show server message in message-area
       div_message.innerHTML = xmlhttp.ResponseText;
    }
    </SCRIPT>

    posted on 2007-07-17 09:47 leoli 閱讀(955) 評論(0)  編輯  收藏 所屬分類: javascript


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    導航

    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    統計

    常用鏈接

    留言簿(6)

    隨筆分類

    隨筆檔案(17)

    文章分類(86)

    收藏夾(3)

    flex blog

    good site

    java blog

    my friend

    tools

    抓蝦

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲综合一区二区| 久久亚洲高清观看| 亚洲精品人成网线在线播放va| 日韩免费高清播放器| 亚洲情a成黄在线观看| 免费无码国产V片在线观看| 日本媚薬痉挛在线观看免费| 亚洲国产精品免费观看 | 国产精品久久免费视频| 亚洲色大成网站www永久男同| 中文字幕无码成人免费视频| 国产精品亚洲综合五月天| 久久不见久久见免费影院| 亚洲 日韩 色 图网站| 久久电影网午夜鲁丝片免费| 亚洲日韩精品无码AV海量| 日韩a在线观看免费观看| 五月天婷婷免费视频| 久久久久久久尹人综合网亚洲| 99精品视频在线观看免费播放| 亚洲福利一区二区三区| 无码国产精品久久一区免费| 亚洲乱码日产精品一二三| 国产一级大片免费看| 国产免费伦精品一区二区三区 | 人妻18毛片a级毛片免费看| 亚洲中文字幕无码日韩| 一级毛片免费观看不卡视频| 亚洲无人区视频大全| 午夜dj免费在线观看| 青青久久精品国产免费看| 国产亚洲精品自在久久| 91香蕉国产线观看免费全集| 亚洲高清一区二区三区| 亚洲乱码中文字幕综合234| 国产一级淫片a免费播放口| 亚洲av无码一区二区三区天堂古代| 最近的中文字幕大全免费版| 一级毛片正片免费视频手机看| 亚洲成AV人片一区二区| 成熟女人牲交片免费观看视频|