MyBB Community Forums

Full Version: How to make text files downloadable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I upload .txt, .inc, .ini, etc. files via attachment form, and click on them after posting the thread, my browser open those files in new tab instead of downloading them like any other files. Whan should I do so those files can be downloaded like any other files? (For example .zip archives)
PS: I am using Chromium.
By default, MyBB makes image and text attachments viewable inline and other attachment types will be downloaded.

It sounds like a web browser behavior. Could you please try again in Incognito mode or in another browser?

Please see reply #3 by Crazycat. Pretty sorry I didn't notice that line before, and thanks Crazycat.
Text files are sent inline too (see https://github.com/mybb/mybb/blob/aaceba...t.php#L182)
You'll have to comment this line and then texts files will be sent as application/force-download

Note that any upgrade of MyBB will remove this hack
Open Chrome on PC;
Navigate to the web page from which you want to download the file;
Save the file:
Most files: Click the download link. Or right-click on the file and select Save As;
Images: Right-click on the image and select Save Image as;
Videos: Hover over the desired video. Click "Download". If you are unable to do so, the owner of the video or host site has blocked downloads;
PDF files: Right-click on the desired file and select Save Link as;
Web pages: Click "More" at the top left, then more tools, then save the page as;
If prompted, select where to save the file, then click save;
Executable files (.exe, .dll, and .bat): If you trust the file, confirm it by clicking Save. If you are unsure about the content of the download, click Skip;
When the download is complete, you will see the file at the bottom of the Chrome window. Click on the file name to open it.

To find a file on a computer, click the down arrow next to the file name, then the down arrow, then display it in a folder, or click "More" and then click View in browser. The files you have downloaded will also be listed on the download page.

Learn how to fix file upload errors.
Pause or cancel download

At the bottom, find the downloaded file that you want to pause or cancel;
Next to the file name at the bottom of the page, click the down arrow down arrow or click "More";
Click Pause, Resume, or Cancel.

View a list of downloaded files

Open Chrome on PC;
At the top left, click "More" and then Downloads;
Click the file name to open it. The file, depending on the type, opens in the default computer program.
Click "Remove" on the left side of the file to remove the download from the history. The file will be removed from the "Downloads" page in Chrome, but will not be removed from your computer.

Download the edited PDF file

You can edit the PDF file online and then save the edited version to your computer.

Go to one of the online PDF forms;
Type PDF form;
Select "Download" Download and then Edit.

Note: You can open the edited PDF file that you have saved and continue the editing process.
(2020-10-10, 02:42 PM)Crazycat Wrote: [ -> ]Text files are sent inline too (see https://github.com/mybb/mybb/blob/aaceba...t.php#L182)
You'll have to comment this line and then texts files will be sent as application/force-download

Note that any upgrade of MyBB will remove this hack

Thank you it works now.