-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupload.php
More file actions
19 lines (16 loc) · 704 Bytes
/
upload.php
File metadata and controls
19 lines (16 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
if(isset($_FILES['image'])){
$file_name = $_FILES['image']['name'];
$file_tmp =$_FILES['image']['tmp_name'];
move_uploaded_file($file_tmp,"images/".$file_name);
echo "<h3>Image Upload Success</h3>";
echo '<img src="images/'.$file_name.'" style="width:100%">';
//exec('"C:\\Program Files (x86)\\Tesseract-OCR\\tesseract" "D:\\xampp\\htdocs\\ocr-test\\images\\'.$file_name.'" out');
shell_exec('"C:\\Program Files (x86)\\Tesseract-OCR\\tesseract" "D:\\xampp\\htdocs\\ocr-test\\images\\'.$file_name.'" out');
echo "<br><h3>OCR after reading</h3><br><pre>";
$myfile = fopen("out.txt", "r") or die("Unable to open file!");
echo fread($myfile,filesize("out.txt"));
fclose($myfile);
echo "</pre>";
}
?>