

Nextrek
@ 537
Nextrek / Android / SmartCharging / endPoints / nightly / upload_image.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 |
<?php 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/nightly/upload_image.php
Revision | Author | Commited | Message |
---|---|---|---|
537
![]() |
![]() |
Mon 24 Aug, 2015 14:46:21 +0000 | |
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) |
400
![]() |
![]() |
Mon 20 Jul, 2015 10:23:38 +0000 | |
378
![]() |
![]() |
Fri 17 Jul, 2015 10:31:22 +0000 | [DA TESTARE E CORREGGERE] Gestione path immagini tramite costanti. |
374 |
![]() |
Fri 17 Jul, 2015 08:20:18 +0000 | Creazione “branch” nightly |