[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Помогите добавить расширения файлов для загрузки
Johnboss
Всем добрый день!

В этом коде жестко прописано, что можно загружать только файлы JPG (file_types : "*.jpg", )
Очень хочется расширить круг файлов.
Не подскажите, как это правильно сделать?

Это фрагмент кода
// File Upload Settings
file_size_limit : "{$photo['photo_max_size']} MB",
file_types : "*.jpg",
file_types_description : "JPG Images",
file_upload_limit : "{$photo['photo_max_q']}",


Это весь код
<?
if( ! defined( 'rootpath' ) ) {
die( "Hacking attempt!" );
}
switch($case) {
case 'title':

include_once 'photo/class/includes.php';
unset($include);
$include = new _includesPhoto();



/* Defines for photo mod */
$CREATING_THUMBNAIL_TXT = TXT('CREATING_THUMBNAIL');
$DOWNLOADING = TXT('DOWNLOADING');
$ABORT_UPLOAD = TXT('ABORT_UPLOAD');
$ALL_IMAGES_RECEIVED = TXT('ALL_IMAGES_RECEIVED');
$true_url = $config['http_script_dir'].'/modules/photo';
$downloadButtonStyle = downloadButtonStyle($true_url);
/* Resize on clients side */
if ($photo['resize_on_client_side']) {
$resize_on_client_side[0] = 'flash9_url : "'.$true_url.'/swfupload/swfupload_fp9.swf",';
$max = $sql->maxOrMin(array('table' => 'photo_size', 'select' => array('height_px')), 'MAX') * 1.2; // +20%
$max = intval($max);
$resize_on_client_side[1] = ',
thumbnail_height: '
.$max.',
thumbnail_width: '
.$max.',
thumbnail_quality: 100'
;
$handlersResizeOnClientSide = '&resize_on_client_side=1';
}

/* Header for photo mod */
$header[] = <<<HTML
<link href="{$true_url}/css.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="
{$true_url}/swfupload/swfupload.js"></script>
<script type="text/javascript" src="
{$true_url}/js/handlers.php?data=js{$handlersResizeOnClientSide}"></script>
<script type="text/javascript">

<!-- text vars -->
var CREATING_THUMBNAIL_TXT = '
{$CREATING_THUMBNAIL_TXT}';
var DOWNLOADING = '
{$DOWNLOADING}';
var ALL_IMAGES_RECEIVED = '
{$ALL_IMAGES_RECEIVED}';
<!-- / text vars -->

var default_type = '
{$photo['photo_type']}';
var default_size = '
{$photo['photo_size']}';
var can_i_leave = true;
window.onbeforeunload = function () {
if (can_i_leave == false) {
return '
{$ABORT_UPLOAD}';
}
};

{$setcookies}
var swfu;
var uni = "
{$session_id}";
var true_url = "
{$true_url}";
var upload_url = "
{$config['path_image_upload']}/photo";
window.onload = function () {
swfu = new SWFUpload({
// Backend Settings
upload_url: "
{$true_url}/upload.php",
post_params: {"PHPSESSID": "
{$session_id}"},
// File Upload Settings
file_size_limit : "
{$photo['photo_max_size']} MB",
file_types : "*.jpg",
file_types_description : "JPG Images",
file_upload_limit : "
{$photo['photo_max_q']}",
// Event Handler Settings - these functions as defined in Handlers.js
// The handlers are not part of SWFUpload but are part of my website and control how
// my website reacts to the SWFUpload events.
// swfupload_load_failed_handler : loadFailed,
swfupload_preload_handler : preLoad,
file_queue_error_handler : fileQueueError,
file_queued_handler : showAjaxBlock,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
// Button Settings

{$downloadButtonStyle}
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,

// Flash Settings
flash_url : "
{$true_url}/swfupload/swfupload.swf",
{$resize_on_client_side[0]}
custom_settings : {
upload_target : "divFileProgressContainer"
{$resize_on_client_side[1]}
},

// Debug Settings
debug: false
});
};
</script>
<script>
jQuery(document).ready(function() {

jQuery(".headOfTheSideBlock.dropdown").click(function() {
var dropDownNextId = jQuery(this).attr('next');

var dropDownNext = jQuery('#'+dropDownNextId);
if ( dropDownNext.css('display') == 'none') {
dropDownNext.show('slide',{ direction: 'up' }, 1000);
jQuery(this).removeClass('img');
jQuery(this).addClass('img2');
} else {
dropDownNext.hide('slide',{ direction: 'up' }, 1000);
jQuery(this).removeClass('img2');
jQuery(this).addClass('img');
}

});

});
</script>
<!-- highslide -->
<script type="text/javascript" src="
{$true_url}/js/highslide/highslide-with-html.js"></script>
<link rel="stylesheet" type="text/css" href="
{$true_url}/js/highslide/highslide.css" />
<script type="text/javascript">
hs.graphicsDir = '
{$true_url}/js/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
//hs.height = '500';
//hs.width = '415';
hs.cacheAjax = false;
hs.preserveContent = false;

</script>
<!-- Jcrop -->
<script src="
{$true_url}/js/Jcrop/jquery.Jcrop.js"></script>
<link rel="stylesheet" href="
{$true_url}/js/Jcrop/jquery.Jcrop.css" type="text/css" />

HTML;
unset($case);
return;
}
include 'photo/encodedIoncube.php';
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.