Author Topic: Attachment Too Large? Rewrite Your Whole Post!  (Read 1330 times)

0 Members and 1 Guest are viewing this topic.

Offline Dullstar

  • Posts: 1582
    • View Profile
    • Leafwing Studios Website (EXTREMELY OUTDATED)
Attachment Too Large? Rewrite Your Whole Post!
« on: September 29, 2017, 01:46:22 am »
Not sure if there's anything that can be done about this, but...

I tried to post something with an attachment, but it was too large. Rather than throwing an error, and allowing me to edit the post/attachments, everything was cleared, and I had to start entirely over (hence why I just posted a topic with the first post pretty much saying nothing but "placeholder").

Tested with starting a new topic, using Firefox as the browser. I haven't tested what happens if you're replying to an existing topic, but will attempt this and see if it gives the same result.

EDIT: I tested it by attempting to post a reply with a large attachment to this thread. It seems that it takes you to the "Start New Topic" page for some reason if the attachment is too large.

Offline mobius

  • Posts: 2317
  • relax.
    • View Profile
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #1 on: September 29, 2017, 01:49:59 am »
I agree this can be aggravating. I recommend putting up a warning [better than the current one] on file sizes

Some sites have an "auto-save" feature (you may see it flash occasionally below the text box like "text saved at X:XX XXX". This site does not.
"Not knowing how near the truth is, we seek it far away."
-Hakwin Rinzai

"Yeah, well, that's just, like, your opinion, man"
-the Dude


Offline Simon

  • Administrator
  • Posts: 2639
    • View Profile
    • Lix
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #2 on: September 29, 2017, 05:50:56 am »
Eeh, that's nasty UI. Thanks, will look into it.

-- Simon

Offline Simon

  • Administrator
  • Posts: 2639
    • View Profile
    • Lix
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #3 on: October 01, 2017, 09:43:47 am »
Yeah, reproduces: Click reply to thread, attach 20 MB file, click Post. Wait until file has uploaded. The site refreshes and presents a blank new-topic form.

Workaround: Back button in the browser restores the form with the written post. (Firefox 55)

This is obviously a terrible workaround because it relies on the browser, who need not be so kind and save such temporary data. :D Options coming to mind:
  • Report upstream (and wait until somebody ever does this, then wait until it sickers through updates),
  • look for forum extensions to install (feeble hope since this is UI misdesign in the core),
  • hack the PHP source in production (Nessy would pitchfork me and it might make the forum hard to upgrade).
-- Simon

Offline Nessy

  • Administrator
  • Posts: 449
    • View Profile
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #4 on: October 01, 2017, 07:17:27 pm »
I would never pitchfork you Simon ;), but in all seriousness I think that this problem can easily be solved using PHP. I can make it so that PHP saves a cookie to the browser that contains the content of the user's post and where it is going to be posted. It will update every few seconds quietly in the background. If the user leaves or the post gets deleted for reasons explained on this thread the cookie will still exist, and the information it stores can be retrieved and pasted automatically in the text box when the user returns. The cookie will only be deleted if the user finally posts or decides to post in another thread. The code would know that by comparing the current topic with the topic saved in that same cookie. If they don't match then the cookie gets cleared for new post content. The advantage of this is that I don't think a user will (or at least very unlikely to) clear their cookies while posting and the cookie will be terminated after posting so it does not linger in the user's browser. If this is done the only page that needs to be updated is the page that is displayed when a user is writing their post.

Offline namida

  • Administrator
  • Posts: 8690
    • View Profile
    • NeoLemmix Website
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #5 on: November 04, 2017, 09:55:44 pm »
Could be an issue if people are writing multiple posts at the same time?

Anyway, regarding the attachments, there are two different issues:
- The forum limits to 16MB. I would rather this wasn't changed; this is fairly generous and since hosting costs are based on amount of storage / bandwidth used, it's preferable that larger files get hosted off-site.
- Uploads from Firefox sometimes time out rather than completing. This can happen even with relatively small files (I've seen it on files of about 3MB), and does not happen when using Internet Explorer or Chrome. This issue may have been fixed, as the last time I noticed it was about 6 months ago.
My released level packs:
Lemmings Plus Series | Doomsday Lemmings

Offline Simon

  • Administrator
  • Posts: 2639
    • View Profile
    • Lix
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #6 on: January 31, 2018, 02:18:34 pm »
This bug is still in the site.

Worse, the limit is 10 MB whereas the site claims it's 16 MB. Anything larger than 10 MB, the site will eat it without warning.

The forum leadership is a big mess: I am head admin, and I don't want to touch the PHP in production. But we don't have a test forum instance, we don't have version control, and I've never told anybody to set up stuff. I discussed this last month on the admin board that stuff belongs in version control, namida agreed, but I didn't do anything based on this. Stuff needs to happen, pronto.

Must discuss with Nessy next time I see him online.

-- Simon

Offline namida

  • Administrator
  • Posts: 8690
    • View Profile
    • NeoLemmix Website
Re: Attachment Too Large? Rewrite Your Whole Post!
« Reply #7 on: January 31, 2018, 11:34:36 pm »
Re: 10 MB limit, I have a feeling it may relate to PHP configuration.

From NFS's FAQ:

Quote
How do I customize my PHP configuration?

You can place customized PHP configuration directives in the file /home/conf/php.ini. This file will not exist by default, so you'll have to create it and make sure it is readable but not writable by the web server (644 permissions). These options will be parsed at the master level (above even PHP_INI_SYSTEM); you may use any directive supported by the version of PHP you are using, including those marked as "php.ini only." Your php.ini file is parsed in addition to, not in lieu of, the system php.ini file, so you only need your site-specific changes.

Note: The php.ini file is not parsed on every request. Changes may take a few minutes of idle time to take effect. (Which, if your site is never idle, may mean they never take effect.) If you want to help it along, you can place your site in maintenance mode or temporarily disable it for a minute or two to ensure that all running processes are killed. Use the phpinfo() function to review the running config and confirm that your changes have been processed.

Examples:

upload_max_filesize = "20M"
display_errors = Off
log_errors = On
extension = "/home/protected/mycustomphpextension.so"

For more information about which PHP configuration directives are available at which level, see the official PHP documentation.
My released level packs:
Lemmings Plus Series | Doomsday Lemmings