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 lang="en"> | |
<meta charset="UTF-8"> | |
<title>Upload</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="jquery.form.js"></script> | |
<script src="progress.js" ></script> |
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 | |
$uploaddir = 'files/'; | |
$uploadfile = $uploaddir . basename($_FILES['arquivo']['name']); | |
echo $uploadfile; | |
echo '<pre>'; | |
if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $uploadfile)) { | |
echo "Arquivo válido e enviado com sucesso.\n"; |
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
$(document).ready(function() { | |
//elements | |
var progressbar = $('#progressbar'); | |
var statustxt = $('#statustxt'); | |
var submitbutton = $("#submit"); | |
var myform = $("#upload"); | |
var output = $("#output"); | |
var completed = '0%'; | |
$(myform).ajaxForm({ | |
beforeSend: 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
<html ng-app="listApp"> | |
<head> | |
<title>Lista Json Com AngularJS</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script> | |
<script src="angularApp.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
var listApp = angular.module('listApp', []); | |
listApp.controller('mainController', function($scope,$http){ | |
$scope.titulo = 'Produtos'; | |
$http.get('json.php').success(function (data) { | |
$scope.produtos = data.produtos; |
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 | |
header('Content-type: application/json'); | |
$completo["produtos"] = array(); | |
$produto1 = array("nome"=>"laranja", "preco"=>5.45, "qtd"=>"5 kg"); | |
array_push($completo["produtos"], $produto1); | |
$produto2 = array("nome"=>"Feijão", "preco"=>7.45, "qtd"=>"1 kg"); | |
array_push($completo["produtos"], $produto2); |
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 readFile(file, callback) { | |
var reader = new FileReader(); | |
reader.onload = callback | |
reader.readAsDataURL(file); | |
} | |
document.getElementsByClassName("arquivos")[0].addEventListener("change", function () { | |
document.getElementsByClassName("miniaturas")[0].innerHTML = ""; | |
document.getElementsByClassName("alert-danger")[0].style.display = "none"; |
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
document.getElementsByClassName("btn")[0].addEventListener("click", function () { | |
var arquivos = document.getElementsByClassName("arquivos")[0].files; | |
var dados = new FormData(); | |
var url = new XMLHttpRequest(); | |
for (var i = 0; i < arquivos.length; i++) { | |
dados.append("arquivo[]", arquivos[i]); | |
} |
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 lang="pt-br"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Upload</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<style> | |
.top-buffer { margin-top:20px; } | |
</style> | |
</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
{ | |
"name": "Meu Primeiro PWA", | |
"short_name": "MP PWA", | |
"icons": [ | |
{ | |
"src": "src/images/icons/app-icon-48x48.png", | |
"type": "image/png", | |
"sizes": "48x48" | |
}, | |
{ |
OlderNewer