zoukankan      html  css  js  c++  java
  • XMLHttpRequest post 传递多个参数及服务器端读取

    一直没搞定XMLHttpRequest  post方法如何传递多种参数,比如同时读取post参数和file参数

     var http = new XMLHttpRequest();

     var form = new FormData();
            // Add selected file to form
            form.append(me.getName(), file);
            form.append('filename', '1.png');
            // Send form with file using XMLHttpRequest POST request
            http.open('POST', me.getUrl());
            http.send(form);


    服务器端

           $uploadfile = $uploaddir . basename($_FILES['userfile']['name']);        
           $uploadfile = $uploaddir . basename($_POST['filename']);   

  • 相关阅读:
    POJ-2393
    POJ-1328
    POJ-2376
    CF-811B
    CF-811A
    CF-816B
    P1111 修复公路
    P2777 [AHOI2016初中组]自行车比赛
    P1889 士兵站队
    P1459 三值的排序 Sorting a Three-Valued Sequence
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/3028597.html
Copyright © 2011-2022 走看看