1<?php
2
3// new filename
4$filename = 'pic_'.date('YmdHis') . '.jpeg';
5
6$url = '';
7if( move_uploaded_file($_FILES['webcam']['tmp_name'],'upload/'.$filename) ){
8 $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']) . '/upload/' . $filename;
9}
10
11// Return image url
12echo $url;