Jump to content
View in the app

A better way to browse. Learn more.

Дизайн и модификация Invision Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Скачивание прикреплений запрещенных типов расширений 3.4.9

Здравствуйте.

Подскажите,как сделать, чтобы можно было скачивать прикрепления отключенных типов расширений?

 

На форуме много файлов с расширением, допустим .exe , сейчас в ац отключена возможность загружать такие расширения. Как сделать, чтобы уже прикрепленные ранее можно было скачивать?

 

Расширение в список добавлено, но просто отключено.

При скачке файла, пишет что он не найден.

Запрашиваемый вами прикрепленный файл не найден.[#10173]

Featured Replies

admin/applications/core/sources/classes/attach/class_attach.php

Найти

			if( is_file( $file ) and ( $attach_cache[ $attach['attach_ext'] ]['atype_mimetype'] != "" ) )

Выше добавить

			if (!isset($attach_cache[$attach['attach_ext']]))
		{
			$attach_cache[$attach['attach_ext']] = $this->DB->buildAndFetch( array( 'select' => 'atype_mimetype', 'from' => 'attachments_type', 'where' => "atype_extension='{$attach['attach_ext']}'" ) );
		}

  • Author

Не помогло.

Пробовал и удалять расширение и отключать.

Пробовал и удалять расширение и отключать.

Не надо ничего удалять.

Типы прикрепляемых файлов хранятся в кеше при условии, что "Разрешить прикреплять этот тип файлов к сообщениям?" установлено Да.

Если не находим нужный, то достаем из базы. Если Вы удалили тип, то естественно будет выдаваться ошибка.

Добавьте перед

			if( is_file( $file ) and ( $attach_cache[ $attach['attach_ext'] ]['atype_mimetype'] != "" ) )

 

			$data = array();

		if (!isset($attach_cache[$attach['attach_ext']]))
		{
			$data[] = 'Нет в кеше';
		}

		if (!is_file($file))
		{
			$data[] = 'Нет файла';
		}

		if (!$this->DB->buildAndFetch( array( 'select' => 'atype_mimetype', 'from' => 'attachments_type', 'where' => "atype_extension='{$attach['attach_ext']}'" ) ))
		{
			$data[] = 'Нет в базе';
		}

		if (count($data))
		{
			$this->registry->getClass('output')->addContent( implode("<br>", $data) );
			$this->registry->getClass('output')->sendOutput();			
		}

 

Попробуйте скачать файл и покажите результат.

  • Author

Спасибо, ваш код работает. Оказалось дело было в хуке (SOS33) Who Downloaded the Attachment 2.0.0

В нем дублируется код файла class_attach.php

Добавил туда ваш фикс, всё заработало!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.