forked from skol-1/medical-imaging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.php
47 lines (34 loc) · 1.06 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
<?php
include("mysqli_connect.php");
$file_name = $_FILES['image']['name'];
if(isset($_FILES['image'])){
$file_name = $_FILES['image']['name'];
$file_size = $_FILES['image']['size'];
$file_tmp = $_FILES['image']['tmp_name'];
$file_type = $_FILES['image']['type'];
if(move_uploaded_file($file_tmp,"upload/".$file_name)){
echo"successfully uploaded.";
}else{
echo"could not upload file";
}
}
/*
$msg = '';
if($_SERVER['REQUEST_METHOD']=='POST'){
$image = $_FILES['image']['tmp_name'];
$img = file_get_contents($file_name);
$dcon = mysqli_connect('localhost','root','','skol') or die('Unable To connect');
$sql = "insert into record (image_text) values(?)";
$stmt = mysqli_prepare($con,$sql);
mysqli_stmt_bind_param($stmt, "s",$img);
mysqli_stmt_execute($stmt);
$check = mysqli_stmt_affected_rows($stmt);
if($check==1){
$msg = 'Image Successfullly UPloaded';
}else{
$msg = 'Error uploading image';
}
mysqli_close($dcon);
}
*/
?>