News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

The message exceeds the maximum allowed length

Started by shorel, March 14, 2023, 10:39:39 AM

Previous topic - Next topic

shorel

I have attempted to copy and paste a small image (35k) in a post and a PM.  On selecting preview, the following error message is displayed:

The message has the following error or errors that must be corrected before continuing:
The message exceeds the maximum allowed length (20000 characters).


Is there a solution to this apart from having to use a url




vbgamer45

Find the setting in
Admin -> Forum - >Posts and Topics -> Post Settings
"Maximum allowed post size"
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Arantor

You're not really supposed to push images directly into the body of a post - that's what attachments are for.

Kindred

Yeah, what arantor said... you can't paste an image into a message
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Well, you *can*, because that's exactly what SCEditor seems to have done (and embedding images inline is completely technically possible using data URLs, whether SMF should do something about that is a completely separate question)

Sesquipedalian

Quote from: Arantor on March 14, 2023, 04:08:40 PMembedding images inline is completely technically possible using data URLs, whether SMF should do something about that is a completely separate question

Data URLs are detected and removed—or more accurately, replaced with the about:invalid URI.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

The OP's situation would suggest otherwise...

Sesquipedalian

The OP's situation occurs at a point before that part of the code can be executed. If the post hadn't already exceeded the maximum message size and generated an error for that reason, the data URI would have been stripped out.

There's a good argument to be made that we should also tweak SCEditor's settings so that attempts to paste an image into the body text will be rejected before the user ever submits anything to the server. But that's a separate matter from the one I was addressing—namely, the notion that it is currently possible to embed images into SMF posts using data URIs.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

Interesting, because that's not what I'd do - I'd convert it to an attachment and use the attach bbcode if it otherwise passes the attachment rules. (And I've implemented this in more than one CMS that uses a different fully HTML editor)

There's not really a compelling reason to make life more difficult on the user for an operation that, in all honesty, they probably don't even realise is happening.

Sesquipedalian

That's a good idea. It would need to be done via JavaScript in the editor, though, in order to get it to play nicely with the attachments system.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Arantor

Nothing stopping you handling it on the server side - you don't have to push it in as a multipart POST, you can extract it on the other side and create attachments out of it.

Sesquipedalian

We would want it to appear as an attachment in the UI when added. This would matter not only for UX reasons, but also because we wouldn't want it to become a way to bypass the attachment restrictions.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

shorel

Many thanks for addressing the issue, and for your time.

Advertisement: