This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name="viewport" content="width=320; user-scalable=no" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>HTML5 Media Capture Demo</title> | |
<script type="text/javascript" charset="utf-8" src="jquery-2.0.0.min.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an image | |
var img = document.createElement("img"); | |
// Create a file reader | |
var reader = new FileReader(); | |
// Set the image once loaded into file reader | |
reader.onload = function(e) | |
{ | |
img.src = e.target.result; | |
img.onload = function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Take or select photo(s)</title> | |
<script type="text/javascript"> | |
function fileSelected() { | |
var count = document.getElementById('fileToUpload').files.length; | |
document.getElementById('details').innerHTML = ""; | |
for (var index = 0; index < count; index ++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_FILES['myFile'])) { | |
// Example: | |
move_uploaded_file($_FILES['myFile']['tmp_name'], "uploads/" . $_FILES['myFile']['name']); | |
echo 'Upload completed!'; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doUpload() { | |
var file = document.getElementById('fileToUpload').files[0]; | |
var dataUrl = ""; | |
// Create an image | |
var img = document.createElement("img"); | |
// Create a file reader | |
var reader = new FileReader(); | |
// Set the image once loaded into file reader | |
reader.onload = function(e) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_POST['image'])) { | |
file_put_contents("uploads/".rand().".png",base64_decode(str_replace("data:image/png;base64,","", $_POST['image']))); | |
echo 'Upload completed!'; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myWorker = new Worker('/path/operazioniDaEseguire.js'); | |
myWorker.onmessage = function(event) { | |
console.log('Fatto, ecco i dati!', event.data); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//stepsToBeMade.js | |
postMessage("So long, and thanks for all the fish."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script id="myWorker"> | |
var i = 0; | |
setInterval(function() { | |
i++; | |
postMessage(i); | |
}, 1000); | |
</script> |
OlderNewer