News:

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

Main Menu

Your attachment couldn't be saved error, but no attachment.

Started by Trios, December 08, 2011, 01:04:47 AM

Previous topic - Next topic

Joker™

Quote from: Kays on December 13, 2011, 02:54:19 PM
Joker, just out of curiosity, check if any of those files are encoded as UTF-8. Especially Post.template.php.
All files mentioned below are in "ANSI"

Post.template.php
Post.php
Subs-Post.php
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Kays

That is a bit strange. Post.template.php is the most likely culprit. Unless it's something specific to that version of PHP?

For now your solution seems to be the best one. That section in Post.php where the file checks are made should be re-written to also look at the php upload errors. Something which is currently not done. Obviously. ::)

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Joker™

Quote from: Kays on December 13, 2011, 03:39:40 PM
That is a bit strange. Post.template.php is the most likely culprit. Unless it's something specific to that version of PHP?
This very bug is pretty specific to PHP 5.3.8. Actually I had placed the same fix on couple of sites yesterday only but most amazing thing is I was not able to produce this error anywhere (i.e home or office).


QuoteFor now your solution seems to be the best one. That section in Post.php where the file checks are made should be re-written to also look at the php upload errors. Something which is currently not done. Obviously. ::)
Thank you. Lets track it for now, so that the dev's can find a much better fix for this(if possible).

Tracked.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Kays

Thanks, that's nice to know. :)

I forgot to check where the code was which you changed. But for that edit on line 985 in Post.php. That code is repeated at around line 1744. It needs to be changed there also since that's where that check is generally made. The other is if there's a posting error.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Joker™

Nice catch Kays.

Edited the post made regarding the fix. Thanks a lot man ;).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Trios

Thank you very much Joker for helping me out with this one. I'm glad I was able to provide a place for you to see this error in action so the troubleshooting could commence. Truth be told, my forum gets just about squat in the way of activity so it was a good testbed in this case.

Thanks again! EDIT: And, marked solved.

Joker™

Glad that I was able to help you out regarding the issue :).

Ahh, a request from my side, please disable those accounts which you have provided me for testing purpose. I like to keep things simple and safe :P.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Trios

The FTP was taken down the evening of, but I admit I forgot about the admin account. It's been nixed.

Thanks again.

Joker™

Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Trios

Oh noes fluffy! Found the error again, this time modifying your profile where you could potentially upload an avatar.

Can anyone think of other places where this error might show up for me to test? When I get home and can modify the source I'll look to see if the error is the same/similar.

Joker™

Well you can try this fix

Sources/Profile-Modify.php (Make backup of file before editing it)

Code (Find:) Select
if ((isset($_FILES['attachment']['name']) && $_FILES['attachment']['name'] != '')

Code (Replace it with") Select
if ((isset($_FILES['attachment']['tmp_name']) && $_FILES['attachment']['tmp_name'] != '')
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Trios


Joker™

Quote from: Trios on January 02, 2012, 12:10:01 AM
That fixed it. Thanks again Joker.
Glad that it got sorted out for you.

P.S - I've made a note for the avatar issue in the bug tracker.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Trios

I'm sure I'll eventually come across some other place where an attachment is asked for and this error rears its ugly head...

Advertisement: