|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
|
|
|
4c79b5 |
# Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# Mantis is free software: you can redistribute it and/or modify
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# GNU General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# along with Mantis. If not, see <http://www.gnu.org/licenses/>.
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# --------------------------------------------------------
|
|
|
4c79b5 |
# $Id: bug_file_upload_inc.php,v 1.39.2.1 2007-10-13 22:32:39 giallu Exp $
|
|
|
4c79b5 |
# --------------------------------------------------------
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# It POSTs to bug_file_add.php
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_core_path = config_get( 'core_path' );
|
|
|
4c79b5 |
require_once( $t_core_path.'file_api.php' );
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# check if we can allow the upload... bail out if we can't
|
|
|
4c79b5 |
if ( ! file_allow_bug_upload( $f_bug_id ) ) {
|
|
|
4c79b5 |
return false;
|
|
|
4c79b5 |
}
|
|
|
4c79b5 |
|
|
|
4c79b5 |
$t_max_file_size = (int)min( ini_get_number( 'upload_max_filesize' ), ini_get_number( 'post_max_size' ), config_get( 'max_file_size' ) );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
collapse_open( 'upload_form' );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
<form method="post" enctype="multipart/form-data" action="bug_file_add.php">
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
collapse_icon( 'upload_form' );
|
|
|
4c79b5 |
echo lang_get( 'upload_file' ) ?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
(' . lang_get( 'max_file_size' ) . ': ' . number_format( $t_max_file_size/1000 ) . 'k)'?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
<input type="hidden" name="bug_id" value="<?php echo $f_bug_id ?>" />
|
|
|
4c79b5 |
<input type="hidden" name="max_file_size" value="<?php echo $t_max_file_size ?>" />
|
|
|
4c79b5 |
<input name="file" type="file" size="40" />
|
|
|
4c79b5 |
<input type="submit" class="button" value="<?php echo lang_get( 'upload_file_button' ) ?>" />
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
</form>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
collapse_closed( 'upload_form' );
|
|
|
4c79b5 |
?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
collapse_icon( 'upload_form' );
|
|
|
4c79b5 |
echo lang_get( 'upload_file' ) ?>
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
collapse_end( 'upload_form' );
|
|
|
4c79b5 |
?>
|