i want to send file to server.
it is a sample in the javascript:
<!DOCTYPE html>
<html>
<head>
<script>
function tabe(){
var file = document.getElementById('files').files[0];
var fd = new FormData;
fd.append('photo',file);
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function(){
alert(this.responseText);
});
xhr.open('post', 'get.php', true);
xhr.send(fd);
}
</script>
</head>
<body>
<form action="get.php" enctype="multipart/form-data" method="post">
<input id="files" name="photo" type="file">
<input type="button" value="آپلود ÙØ§ÛŒÙ„" onclick="tabe();">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script>
function tabe(){
var file = document.getElementById('files').files[0];
var fd = new FormData;
fd.append('photo',file);
var xhr = new XMLHttpRequest();
xhr.addEventListener('load', function(){
alert(this.responseText);
});
xhr.open('post', 'get.php', true);
xhr.send(fd);
}
</script>
</head>
<body>
<form action="get.php" enctype="multipart/form-data" method="post">
<input id="files" name="photo" type="file">
<input type="button" value="آپلود ÙØ§ÛŒÙ„" onclick="tabe();">
</form>
</body>
</html>
To copy to clipboard, switch view to plain text mode
i want to do that in the qml.
Bookmarks