Server IP : 103.6.199.200 / Your IP : 3.137.162.21 Web Server : Microsoft-IIS/10.0 System : Windows NT EMPUSA 10.0 build 20348 (Windows Server 2016) i586 User : EMPUSA$ ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Domains/tradepan/hhgclub.net/wwwroot/ |
Upload File : |
<%@ page language="C#" autoeventwireup="true" inherits="ixii, App_Web_jt4vbext" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <link rel="stylesheet" href="assets/css/styles.css"> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.2.min.js" type="text/javascript"></script> <script type="text/Javascript" language="Javascript"> function drawShapes() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); context.fillStyle = "Blue"; context.fillRect(0, 0, 200, 200); context.beginPath(); context.lineWidth = "4"; context.strokeStyle = "Green"; context.fillStyle = "Yellow"; context.arc(150, 100, 50, 20, Math.PI * 2, false); context.font = "30px Arial"; context.strokeText("3", 20, 40); context.strokeText("4", 40, 40); context.strokeText("5", 60, 40); context.strokeText("6", 80, 40); context.stroke(); context.fill(); } function UploadFile() { var formData = new FormData(); var file = document.getElementById("File1").files[0]; formData.append("file", file); // var sendStr = "{name:'dddd'}" ; var uploadServerSideScriptPath = "ixii.aspx"; var xhr = new XMLHttpRequest(); xhr.open("POST", uploadServerSideScriptPath, false); xhr.setRequestHeader("Content-Type", "multipart/form-data"); //xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("X-File-Name", file.name); xhr.setRequestHeader("X-File-Size", file.size); xhr.setRequestHeader("X-File-Type", file.type); xhr.send(formData); } </script> <title>Untitled Page</title> </head> <body onload="drawShapes();"> <form id="form1" runat="server"> <div> <input id="File1" type="file" /> <input id="Button3" type="button" value="button" onclick="UploadFile()" /> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" /> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <div class="container"> <div class="app"> <a href="#" id="start-camera" class="visible">Touch here to start the app.</a> <video id="camera-stream"></video> <img id="snap"> <p id="error-message"></p> <div class="controls"> <a href="#" id="delete-photo" title="Delete Photo" class="disabled"><i class="material-icons">delete</i></a> <a href="#" id="take-photo" title="Take Photo"><i class="material-icons">camera_alt</i></a> <a href="#" id="download-photo" download="selfie.png" title="Save Photo" class="disabled"><i class="material-icons">file_download</i></a> </div> </div> </div> </div> <div> <!-- Hidden canvas element. Used for taking snapshot of video. --> <canvas id="myCanvas" width="200" height="200"></canvas> <input type="button" id="btnSave" name="btnSave" value="Save the canvas to server" /> <script type="text/javascript"> // Send the canvas image to the server. $(function() { $("#btnSave").click(function() { var image = document.getElementById("myCanvas").toDataURL("image/png"); // var image = document.getElementById("myCanvas").toBlob(postFile, 'image/jpeg'); // image = image.replace('data:image/png;base64,', ''); // $.ajax({ // type: 'POST', // url: 'ixii.aspx/UploadImage', // data: '{ "imageData" : "' + image + '" }', // contentType: 'application/json; charset=utf-8', // dataType: 'json', // success: function(msg) { // alert('Image saved successfully !'); // } // }); //2---------- // var postdata='ixii.aspx'; // ajax.open('POST', postdata, false); // ajax.setRequestHeader('Content-Type', 'application/upload'); // ajax.send(image); //3 --------- var uploadServerSideScriptPath = "ixii.aspx"; var xhr = new XMLHttpRequest(); xhr.open("POST", uploadServerSideScriptPath, false); xhr.setRequestHeader('Content-Type', 'application/upload'); //xhr.setRequestHeader("Content-Type", "multipart/form-data"); //xhr.setRequestHeader("Content-Type", "application/json"); // xhr.setRequestHeader("X-File-Name", file.name); // xhr.setRequestHeader("X-File-Size", file.size); // xhr.setRequestHeader("X-File-Type", file.type); xhr.send(image); }); }); </script> </div> </form> <script src="assets/js/script.js"></script> </body> </html>