Welcome Guest, Not a member yet? Register   Sign In
Webcam capture image problem in codeigniter
#1

[eluser]Unknown[/eluser]
I am using the webcam to capture the image
Photo is also capture but only when


in the below case :
like main.php is the controller , in which if i call the view in index() :

if i make the another function in controller and call the view then photo is
not capture and uploaded also...

I am using webcam.js file for that

<?php
if(!defined('BASEPATH')) exit ('NO direct script access allowed');


class Main extends CI_Controller
{
public function __constructor()
{
parent::__construct();
}
public function index()
{
$this->load->view('edit_photo');
}

public function edit()
{

// $this->load->view('edit_photo');
}
public function webcam()
{
$filename = date('YmdHis') . '.jpg';
$result = file_put_contents( "upload/".$filename, file_get_contents('php://input') );
if (!$result)
{
print "ERROR: Failed to write data to $filename, check permissions\n";
exit();
}
$url = 'http://localhost/CodeIgniter_2.0.3/upload/'.$filename;
print "$url\n";
}
/* public function img()
{
$this->load->helper('download');
$data = file_get_contents("http://localhost/CodeIgniter_2.0.3/upload/"); // Read the file's contents
$name = 'Desert.jpg';
force_download($name, $data);
} */
}




Theme © iAndrew 2016 - Forum software by © MyBB