

Nextrek
@ HEAD
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 header("Access-Control-Allow-Origin: *"); //header('Content-Type: multipart/form-data; charset=UTF-8'); header('Content-Type: application/json; charset=UTF-8'); session_start(); require_once("constants.php"); //var_dump($_SESSION); /*if (!array_key_exists("images", $_SESSION)) { $_SESSION["images"] = array(); }*/ $image_filename = ""; $risposta = array(); $risposta["return"] = 0; if(isset($_FILES['image_file'])) { $file = $_FILES['image_file']; if($file['error'] == UPLOAD_ERR_OK and is_uploaded_file($file['tmp_name'])) { $imgExtention = substr(strrchr($file["name"],'.'),1); $image_filename = uniqid().".".$imgExtention; //echo session_id(); /*if (!file_exists($_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id())) { mkdir($_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id(), 0777, true); }*/ //move_uploaded_file($file['tmp_name'], $_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH.session_id()."/".$image_filename); move_uploaded_file($file['tmp_name'], $_SERVER['DOCUMENT_ROOT'].TEMP_IMAGES_PATH."/".$image_filename); //array_push($_SESSION["images"], $image_filename); } else { $risposta = createErrorMessage(1, "Errore nel caricare l'immagine"); //$risposta["return"] = 1; } } $risposta["image_file"] = $image_filename; echo json_encode($risposta); ?> |
Commits for Nextrek/Android/SmartCharging/endPoints/upload_image.php
Revision | Author | Commited | Message |
---|---|---|---|
747
![]() |
![]() |
Wed 16 Sep, 2015 14:56:36 +0000 | |
746
![]() |
![]() |
Wed 16 Sep, 2015 14:48:09 +0000 | |
603
![]() |
![]() |
Fri 28 Aug, 2015 12:01:45 +0000 | |
579
![]() |
![]() |
Thu 27 Aug, 2015 08:25:11 +0000 | |
507
![]() |
![]() |
Thu 20 Aug, 2015 07:51:22 +0000 | Merge ramo stable con la nightly. |
441
![]() |
![]() |
Tue 28 Jul, 2015 08:01:07 +0000 | Rimossa creazione delle cartelle temporanee per le immagini (ora verranno tutte salvate nella root di temp) |
309
![]() |
![]() |
Mon 13 Jul, 2015 16:08:26 +0000 | |
304
![]() |
![]() |
Mon 13 Jul, 2015 15:36:12 +0000 | |
302 |
![]() |
Mon 13 Jul, 2015 15:29:06 +0000 |