Nextrek
Diff Revisions
506
vs
507
for /Android/SmartCharging/endPoints/upload_image.php
|
@@ -1,6 +1,8 @@ |
1 |
1 |
|
<?php |
2 |
2 |
|
session_start(); |
3 |
3 |
|
|
|
4 |
+ |
require_once("constants.php"); |
|
5 |
+ |
|
4 |
6 |
|
//var_dump($_SESSION); |
5 |
7 |
|
|
6 |
8 |
|
/*if (!array_key_exists("images", $_SESSION)) { |
|
@@ -20,11 +22,12 @@ |
20 |
22 |
|
$image_filename = uniqid().".".$imgExtention; |
21 |
23 |
|
//echo session_id(); |
22 |
24 |
|
|
23 |
|
- |
/*if (!file_exists("./images/temp/".session_id())) { |
24 |
|
- |
mkdir("./images/temp/".session_id(), 0777, true); |
|
25 |
+ |
/*if (!file_exists($_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id())) { |
|
26 |
+ |
mkdir($_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id(), 0777, true); |
25 |
27 |
|
}*/ |
26 |
28 |
|
|
27 |
|
- |
move_uploaded_file($file['tmp_name'], "./images/temp/".$image_filename); |
|
29 |
+ |
//move_uploaded_file($file['tmp_name'], $_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id()."/".$image_filename); |
|
30 |
+ |
move_uploaded_file($file['tmp_name'], $_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH."/".$image_filename); |
28 |
31 |
|
//array_push($_SESSION["images"], $image_filename); |
29 |
32 |
|
} |
30 |
33 |
|
else { |