@m7dev

Как внедрить maxFileSize через JS Setting?

Приветствую, нужно внести ограничение по размеру файлов в 24 мб в BOOTSTRAP UPLOADS через script на HTML странице $("#selector").fileinput

К сожалению со всеми подсказками я понятия не имею как это сделать...

Есть следующие подсказки:
Уведомление о превышении размера

msgSizeTooLarge
string, the message to be displayed when the file size exceeds maximum size set in maxFileSize. Defaults to:

File "{name}" ({size} KB) exceeds maximum allowed upload size of {maxSize} KB. Please retry your upload!
where:

{name}: will be replaced by the file name being uploaded
{size}: will be replaced by the uploaded file size
{maxSize}: will be replaced by the maxFileSize parameter.


Сама функция ограничения

maxFileSize
float, the maximum file size for upload in KB. If greater than this, a validation error is thrown using the msgSizeTooLarge setting. If set to 0, it means size allowed is unlimited. Defaults to 0.


Помогите пожалуйста!
  • Вопрос задан
  • 71 просмотр
Пригласить эксперта
Ответы на вопрос 1
@m7dev Автор вопроса
Пробовал, вот так, но здесь явно что то не так.
<script >
		$(document).ready(function() {

			$("input-3").fileinput({
				maxFileSize: 24000,
				msgSizeTooLarge: 'File "{name}" (<b>{customSize}</b>) exceeds maximum allowed upload size of <b>{customMaxSize}</b>. Please retry your upload!'
			});
			
		});

	</script>
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы