-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
35 lines (24 loc) · 868 Bytes
/
upload.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<?php
header('Content-Type: text/html; charset=utf-8');
// Check if image file is a actual image or fake image
if($_SERVER['REQUEST_METHOD']== "POST"){
echo "POSTeeeee"; //Não está a guardar a imagem
if(isset($_FILES['file'])){
print_r($_FILES);
echo ("".$_FILES["file"]["name"].PHP_EOL);
echo ("".$_FILES["file"]["size"].PHP_EOL);
echo ("".$_FILES["file"]["tmp_name"].PHP_EOL);
move_uploaded_file($_FILES["file"]["tmp_name"],"imgs/webcam.jpg");
}
else if(isset($_FILES['imagem'])) {
echo "POST";
echo ("".$_FILES["imagem"]["name"].PHP_EOL);
echo ("".$_FILES["imagem"]["size"].PHP_EOL);
echo ("".$_FILES["imagem"]["tmp_name"].PHP_EOL);
move_uploaded_file($_FILES["imagem"]["tmp_name"],"imgs/webcam.png");
}else{
echo ("Erro nos dados enviados");
}
}
?>