Commit 7c5e8cb0 authored by Chef Projet Prodige's avatar Chef Projet Prodige
Browse files

Merge branch 'develop' into 'master'

add toEditing parameter to return directly geojson

See merge request alkante/bdl_visualiseur_core!3
parents 1ebc4b32 7aa404a0
......@@ -141,6 +141,17 @@ class UploadController extends ControllerBase
} elseif (isset($jsonFile)) {
$jsonFile->moveTo($targetDirectory . $this->sanitizeFilename($jsonFile->getName()));
$mainFilename = $this->sanitizeFilename($jsonFile->getName());
//for json upload, directly return geojson when it's necessary
$isToEditing = $this->request->get("to_editing");
$isToEditing = intval($isToEditing) ? true : false;
if ($isToEditing){
return $response->setJsonContent(
array('data' => json_decode(file_get_contents($targetDirectory.$mainFilename), true),
'type' => 'json',
'success' => true));
}
} elseif (isset($csvFile)) {
$csvFile->moveTo($targetDirectory . $this->sanitizeFilename($csvFile->getName()));
$mainFilename = $this->sanitizeFilename($csvFile->getName());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment