From 1693d9da122a8d5ef8b169b542097556d9c6d86e Mon Sep 17 00:00:00 2001 From: Fil <fil@rezo.net> Date: Sun, 23 Jan 2005 15:22:37 +0000 Subject: [PATCH] =?UTF-8?q?retour=20du=20message=20d'erreur=20"""=20Ce=20f?= =?UTF-8?q?ichier=20est=20trop=20gros=20pour=20le=20serveur|=20;=20la=20ta?= =?UTF-8?q?ille=20maximum=20autoris=C3=A9e=20en=20uplod=20est=20de=202M.?= =?UTF-8?q?=20"""?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On pourrait faire mieux, tracer les 4 codes d'errur précisément, fichier uploadé par fichier uploadé... mais bon. --- ecrire/inc_getdocument.php3 | 12 +++++++++++- spip_image.php3 | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ecrire/inc_getdocument.php3 b/ecrire/inc_getdocument.php3 index 3276f8e5ae..4fa6864b86 100644 --- a/ecrire/inc_getdocument.php3 +++ b/ecrire/inc_getdocument.php3 @@ -226,7 +226,17 @@ function ajout_doc_zip($image, $image_name, $mode, $forcer_document, $action_zip ajout_doc_s($image, $image_name, $mode, $forcer_document,$id_document, $hash); } -function ajout_doc_s($image, $image_name, $mode, $forcer_document, $id_document, $hash) { +function ajout_doc_s($image, $image_name, $mode, $forcer_document, $id_document, $hash, $error=0) { + + if ($error /* on pourrait affiner avec UPLOAD_ERR_INI_SIZE */) { + include_ecrire('inc_presentation.php3'); + install_debut_html(_T('forum_titre_erreur')); + echo "<p>"._T('upload_limit', + array('max' => ini_get('upload_max_filesize'))); + install_fin_html(); + exit; + } + $mode = ($forcer_document == 'oui' ? "document" : $mode); if (!is_dir($image_name)) { diff --git a/spip_image.php3 b/spip_image.php3 index fa4f253983..57a44542e9 100644 --- a/spip_image.php3 +++ b/spip_image.php3 @@ -433,7 +433,7 @@ else { foreach ($_FILES as $file) { // ajout d'un doc normal if (!eregi("\.zip$",$file['name']) OR count($_FILES) > 1) - ajout_doc_s($file['tmp_name'], $file['name'], $mode, $forcer_document, $id_document, $hash); + ajout_doc_s($file['tmp_name'], $file['name'], $mode, $forcer_document, $id_document, $hash, $file['error']); else // ajout d'un doc au format zip { -- GitLab