![]() |
|
|
Регистрация Восстановить пароль |
Регистрация | Задать вопрос |
Заплачу за решение |
Новые сообщения |
Сообщения за день |
Расширенный поиск |
Правила |
Всё прочитано |
![]() |
|
Опции темы
![]() |
Поиск в этой теме
![]() |
![]() |
#1 |
Новичок
Джуниор
Регистрация: 03.12.2011
Сообщений: 1
|
![]()
Дорогие программисты,у меня есть сайт и есть большая проблема
![]() Сайт похоже на "обмен фотографиями" Проблема в том что когда загружается на сайте больше 10,000 х 10,000 пикселей фото,сервер загружается и Internal server error 500.поэтому надо ставит лимит для загружаемых фотографиях.Использую CakePHP но код javascript.Поставил лимит для SIZE , type и так далее но не могу поставит лимит для больших пикселных фотках Код HTML:
<head> // удалил не нужные коды чтоб не был лишком длинный var progress = new FileProgress(file, this.customSettings.progressTarget); progress.setError(); progress.toggleCancel(false); switch (errorCode) { case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT: progress.setStatus("большая мб фотка."); this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); break; case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE: progress.setStatus("неверный формат."); this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message); break; } } catch (ex) { this.debug(ex); } } function uploadProgress(file, bytesLoaded, bytesTotal) { try { var percent = Math.ceil((bytesLoaded / bytesTotal) * 100); var progress = new FileProgress(file, this.customSettings.progressTarget); progress.setProgress(percent); progress.setStatus("<?php echo ucfirst(__('uploading', true)) ?>..."); } catch (ex) { this.debug(ex); } } function uploadSuccess(file, serverData) { try { var progress = new FileProgress(file, this.customSettings.progressTarget); progress.setComplete(); progress.setStatus("<?php echo ucfirst(__('uploaded', true)) ?>."); progress.toggleCancel(false); } catch (ex) { this.debug(ex); } } function uploadError(file, errorCode, message) { try { var progress = new FileProgress(file, this.customSettings.progressTarget); progress.setError(); progress.toggleCancel(false); switch (errorCode) { case SWFUpload.UPLOAD_ERROR.HTTP_ERROR: progress.setStatus("вы не можете загружать еще фото! "); this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message); break; case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED: // If there aren't any files left (they were all cancelled) disable the cancel button if (this.getStats().files_queued === 0) { document.getElementById(this.customSettings.cancelButtonId).disabled = true; $("finish_uploading_button").show(); } progress.setStatus("<?php echo ucfirst(__('cancelled', true)) ?>"); progress.setCancelled(); break; } } catch (ex) { this.debug(ex); } } function uploadComplete(file) { if (this.getStats().files_queued === 0) { document.getElementById(this.customSettings.cancelButtonId).disabled = true; $("finish_uploading_button").show(); } } var swfu; window.onload = function() { var settings = { flash_url : "<?php echo $this->webroot ?>swf/swfupload.swf", upload_url: "<?php echo $html->url('/photos/upload?PHPSESSID=' . session_id() . '&privacy=' . $_GET['privacy'], true) ?>", // Relative to the SWF file post_params: {}, file_size_limit : "1 MB", file_types : "*.jpg;*.png", file_types_description : "фотки", file_upload_limit : 100, file_queue_limit : 0, custom_settings : { progressTarget : "fsUploadProgress", cancelButtonId : "btnCancel" }, debug: false, // Button Settings button_placeholder_id : "spanButtonPlaceholder", button_width: 80, button_height: 30, file_queued_handler : fileQueued, file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_start_handler : uploadStart, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, queue_complete_handler : queueComplete }; swfu = new SWFUpload(settings); }; </script> <?php endif ?> </head> <body> |
![]() |
![]() |
![]() |
![]() |
||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
Запросить лимит | kzld | JavaScript, Ajax | 10 | 23.07.2009 10:36 |
Инициализация загружаемых компонент | Oburec | Компоненты Delphi | 0 | 12.07.2009 19:04 |
Имена загружаемых файлов на кириллице | krok | PHP | 3 | 05.12.2008 10:42 |
Лимит на Интернет? | Detka | Свободное общение | 5 | 25.08.2008 07:20 |