-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.php
More file actions
27 lines (27 loc) · 1.1 KB
/
Copy pathcommand.php
File metadata and controls
27 lines (27 loc) · 1.1 KB
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
<?php
if(isset($_POST['file']) && file_exists($_POST['file'])) {
if(isset($_POST['token']) && !empty($_POST['token'])){
require_once('core/sync/tables.php');
require_once('core/db.php');
$token_exist = $db->where('session_id', $_POST['token'])->get(T_SESSIONS,1,array('*'));
if($token_exist){
require_once("core/zipy/spaces-api-master/spaces.php");
$data = array();
$configs = $db->get(T_CONFIG,null,array('name','value'));
foreach ($configs as $key => $config) {
$data[$config->name] = $config->value;
}
if($data['digital_ocean'] == '0' ){
exit();
}
$key = $data['digital_ocean_key'];
$secret = $data['digital_ocean_s_key'];
$space_name = $data['digital_ocean_space_name'];
$region = $data['digital_ocean_region'];
$space = new SpacesConnect($key, $secret, $space_name, $region);
$path_to_file = $_POST['file'];
$space->UploadFile($path_to_file, "public");
}
}
}
exit();