From 4c6b6293cf214eaa5e5bccee4326687bf12b626d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr> Date: Thu, 22 Jan 2015 15:26:19 +0100 Subject: [PATCH] Compat IE. --- Controller/UploadController.php | 7 ++++++- Resources/views/Form/file_upload.html.twig | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Controller/UploadController.php b/Controller/UploadController.php index ea29e3a7..564964cc 100644 --- a/Controller/UploadController.php +++ b/Controller/UploadController.php @@ -66,7 +66,12 @@ class UploadController extends Controller { $data = $request->request->get('file'); - $file = $this->fileManager->create($data['name'], $data['size'], $data['type'], $data['lastModified']); + $file = $this->fileManager->create( + $data['name'], + $data['size'], + $data['type'], + isset($data['lastModified']) ? $data['lastModified'] : null + ); $token = $this->csrfProvider->generateCsrfToken(self::CSRF_INTENTION); diff --git a/Resources/views/Form/file_upload.html.twig b/Resources/views/Form/file_upload.html.twig index 53f72846..8bec7d57 100644 --- a/Resources/views/Form/file_upload.html.twig +++ b/Resources/views/Form/file_upload.html.twig @@ -15,7 +15,7 @@ {% endblock %} {% block file_upload_widget %} - <div id="{{ id }}" {{ block('widget_container_attributes') }} {{ block('widget_only_attributes') -}} + <div id="{{ id }}" {{ block('widget_container_attributes') }} {{ block('widget_only_attributes') }} data-download-prototype="{{ block('file_upload_entry_prototype')|e }}" data-upload-prototype="{{ block('file_upload_progress_prototype')|e }}" {% if disabled %}data-disabled="disabled"{% endif -%} -- GitLab