how to save snap in webcap in php codeigniter

Solutions on MaxInterview for how to save snap in webcap in php codeigniter by the best coders in the world

showing results for - "how to save snap in webcap in php codeigniter"
Roberta
16 Sep 2019
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;