<%@ Page Language="C#" AutoEventWireup="true" Inherits="Kesion.NET.WebSite.TestPPt" Codebehind="TestPPt.aspx.cs" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link href="/admin/images/style.css" rel="stylesheet" type="text/css" />
<script src="../../admin/images/pannel/tabpane.js" type="text/javascript"></script>
<link href="/admin/images/pannel/tabpane.CSS" rel="stylesheet" type="text/css" />
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>
<script src="/KS_Inc/jQuery.js"></script>
<script src="/KS_Inc/Kesion.Common.js"></script>
<script  type="text/javascript">

    function postVedio() {
        
        var fileObj = document.getElementById("fileupload1").files[0];
       
        var fileObj1 = document.getElementById("fileupload2").files[0];

        var sign = '<%=sign%>';
        var ptime = '<%=ptime%>';

        var JSONRPC = "{\"vid\":\"738f47676e97a427420758a7ed53b41a_7\",\"sign\":\"" + sign + "\",\"ptime\":\"" + ptime + "\,\"ppt\":\"" + fileObj + "\,\"txt\":\"" + fileObj1 + "\"}";

        //  var JSONRPC = "{\"vid\":\"738f47676e97a427420758a7ed53b41a_7\",\"sign\":\"" + sign + "\",\"ptime\":\"" + ptime + "\"}";
        var form = new FormData();
       
       // alert(JSONRPC);

        form.append("JSONRPC", JSONRPC);
       
        //form.append("ppt", fileObj);
        //form.append("txt", fileObj1);

        var xhr = new XMLHttpRequest();
        $("#Loading").show();
        xhr.open("post", "http://api.polyv.net/v2/video/738f47676e/uploadPPT", true);

        xhr.onload = function () {


            var jsonObject = JSON.parse(xhr.response);

            if (jsonObject.error == 0) {
                $("#Loading").hide();
                 alert("fdffggfgfgf");

                 //alert(jsonObject.error);
                // alert(jsonObject.data[0].filesize);

              


               }
               else {
                $("#Loading").hide();
                alert("ddasds");
              
            }

        };

        xhr.send(form);


    }
</script>
</head>
<body>
	<div id="manage_top" class="toptitle menu_top_fixed">
    	上传视频
    </div>
    <div class="menu_top_fixed_height"></div>
    <div class="content-area">
        <form id="Formvideo" enctype="multipart/form-data" >
           
              <div class="prompt_bg" style="display:none" id="Loading">
                <div class="prompt_box">
                  <p><img src="/admin/weixin/images/loading.gif" />正在上传，因为文件有点大，可能有点卡，请勿刷新，请耐心等待...</p>
                </div>
            </div>
            <table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="CTable">
      
              <tr>
                    <td align="right" class="lefttd" height="30"><font color="red">*</font>上传视频文件</td>
                     <td class="righttd">
                   
                          ppt:<input type="file" name="ppt" id="fileupload1"  />
                        
                           
                   </td>
                 </tr>

                <tr>
                    <td align="right" class="lefttd" height="30"><font color="red">*</font>上传视频文件</td>
                     <td class="righttd">
                   
                           txt:<input type="file" name="txt" id="fileupload2" /><br>
                        
                           
                   </td>
                 </tr>
                </table>
            
        </form>
    <div class="main-button">
    <input type="button" onclick="postVedio();" class="button" value="确定上传">
    </div>
  </div>
</body>
</html>

