-
Notifications
You must be signed in to change notification settings - Fork 0
/
processUploads2.php
48 lines (36 loc) · 1.36 KB
/
processUploads2.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
<?php
header("Access-Control-Allow-Origin: *");
//$uploadedFiles = $_FILES['file']['tmp_name'];
//echo $uploadedFiles;
//move_uploaded_file($uploadedFiles, "http://www.enjoysandiego.com/upload/new_whale.jpg");
//echo "100";
//$now = date("YmdHis");
$data = $_POST['file'];
$filename = $_POST['imagename'];
$uploadLocation = $_POST['uploadLocation'];
list($type, $data) = explode(';', $data);
list(, $data) = explode(',', $data);
// $data = str_replace(' ','+',$data);
if($uploadLocation == 'exacttarget'){
$data = base64_decode($data);
file_put_contents("upload/".$filename, $data);
$ET_file = "http://www.mylittleemailbuilder.com/upload/".$filename;
include 'puttoportfolio.php';
}else if($uploadLocation == 'myleb_folder'){
$today = date('Y_m');
if(!file_exists("upload/".$today)){
mkdir("upload/".$today,0777,true);
}
$data = base64_decode($data);
file_put_contents("upload/".$today."/".$filename, $data);
$myvar = array(
'url'=> 'http://www.mylittleemailbuilder.com/upload/'.$today."/".$filename
);
echo json_encode($myvar);
}else{
$filename = explode(".",$filename);
$filename = $filename[0];
include '00-Includes/putCloudinary.php';
//include 'putCloudinary.php';
}
?>