-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileProcess.php
65 lines (57 loc) · 1.98 KB
/
fileProcess.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
require('dbconnect.php');
require('way2sms-api.php');
require('tp.php');
$sender = $_SESSION['mobile'];
//$email="";
$reciever = $_POST["reciever"];
$info = pathinfo($_FILES['fileToUpload']['name']);
$ext = $info['extension']; // get the extension of the file
$newname = "newname.".$ext;
echo $_FILES['fileToUpload']['tmp_name'];
$target_file = basename($_FILES["fileToUpload"]["name"]);
echo "<br>";
echo $target_file;
$target_file = str_replace(' ', '_', $target_file);
$target = 'new/'.$target_file;
echo "<br>";
echo $target_file;
$status= move_uploaded_file( $_FILES['fileToUpload']['tmp_name'], $target);
$secretkey = "yash";
//,`encryptpath`,`decryptpath`,`secretkey`
if($status == 1)
{
$conn->query("INSERT INTO `filestore` (`file_id`,`sender`,`reciever`, `filename`) VALUES (NULL,'$sender','$reciever','$target_file');");
echo "file uploaded";
$printstatus = shell_exec("java EncryptFile ".$target_file );
echo $printstatus;
echo "done!!!!";
$result = $conn->query("select * from register where mobile = '$sender';");
$row = mysqli_fetch_array($result);
$sendername = $row['name'];
$sender = "TXTLCL";
$message = $sendername." has sent you file please login/register on BLOWTRANSFER to access the file";
echo "</br>";
echo $msg;
//sendWay2SMS("9987262313", "diArY32", $reciever, $msg);
sendSms($reciever, $message, $sender);
// header('Location: dashboard.php');
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('File Sent')
window.location.href='uploadFile.php';
</SCRIPT>");
}
else
{
// echo "<br>";
// //echo "otp expired . try again";
echo ("<SCRIPT LANGUAGE='JavaScript'>
window.alert('Failed')
window.location.href='uploadFile.php';
</SCRIPT>");
}
//shell_exec("javac EncryptFile.java");
//
//echo $abc
?>