News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Attachments: File not found

Started by Imago, September 10, 2022, 11:47:55 PM

Previous topic - Next topic

Imago

Files are there, names and addresses are correct in the form of /index.php?action=dlattach;topic=1805.0;attach=397 - but when you click you get an empty page with "File not found."

All this after the upgrade to 2.1.2

Is there any way to re-index the attachments directory?

Sir Osis of Liver

Do all the hashed filenames have a .dat extension?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Imago


Kindred

Сл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."

Doug Heffernan

I think that this is the bug with the attachments being gone after upgrading to 2.1.2. from 2.0.x and even older versions.


Sir Osis of Liver

Upload attached script to forum root, run it with direct link.  It will add .dat extension to those files that don't have it.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Chen Zhen


You should use an identical comparison operator ( === ) for the srpos() function else there may be an unintended result.

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Sir Osis of Liver

Will try it, thanks.

Revised script attached.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

Quote from: Doug Heffernan on September 11, 2022, 02:36:42 PMI think that this is the bug with the attachments being gone after upgrading to 2.1.2. from 2.0.x and even older versions.

Why does it happen only on a few forums?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

I'm not aware of a specific bug where a 2.1 upgrade loses pix.

The upgrader is definitely sensitive to improper settings, e.g., if the attachment folders are incorrect.  This can happen after a forum move/restore; you should run repair_settings.php prior to upgrading to ensure smf knows where your folders are - esp attachments...

You absolutely MUST be upgrading a fully working forum, with proper settings & folders, or bad things happen...

The upgrader is also sensitive to certain types of db changes that cause the upgrader to crash.  Anything that would cause the sql to fail, e.g., removed columns or tables. Columns added by mods with no default, etc.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Imago

#10
Quote from: Sir Osis of Liver on September 11, 2022, 05:22:43 PMWill try it, thanks.

Revised script attached.

.dat has been added to all attachments. The result is still File not found.

The upgrade was from 1.1.21 and many times stuck at saving hash for attachments.

What if I install Attachment Browser, let it add all tags and save?

Imago

Quote from: Imago on September 12, 2022, 03:59:01 AM
Quote from: Sir Osis of Liver on September 11, 2022, 05:22:43 PMWill try it, thanks.

Revised script attached.

.dat has been added to all attachments. The result is still File not found.

Except for some 30 files from 2009 that somehow have been saved with their hash instead of real name. They are now downloadable.

Sir Osis of Liver

Have you tried upgrading 1.1.21 to 2.0.19?

Post screenshot of your /attachments.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Imago

Yes, many times - always with encoding errors.

This is the /attachments. From 405 to 465 files are downloadable. All other files containing the name or both the name and the hash are not found.




Sir Osis of Liver

If that's from 2.1.2, upgrade did not complete.  Avatars should have been moved from /attachments to /custom_avatar.  They are now broken because .dat extension was added to the existing extension.  You'll have to revert to 1.1.21, make sure it's working correctly.

PM sent.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Imago

#15
UPDATE: Managed to upgrade to 2.0.19 by replacing the russian language file with russian-utf8 file. For some reason the russian, as well as the bulgarian language files for versions under 2.1.x are utf8 encoded w/o BOM, but do not allow of UTF-8, so you have to install the specific -utf8 files.

In 2.0.19 all attachments and avatars are available and visible.

Upgrade to 2.1.2 went flawlessly - except for attachments and avatars.

Fixed the attachments with the attachfix2.php - thanks to Sir Osis of Liver! - and now what remains unfixed is the avatar location. They are still in the /avatar dir but are not displayed. There is nothing in the /custom_avatar

PS. Moved whatever avatar available to /custom_avatar and now Oll is Korrect :-)

Steve

Quote from: Imago on September 15, 2022, 04:22:34 AMPS. Moved whatever avatar available to /custom_avatar and now Oll is Korrect :-)
Does that mean this can be marked solved?
DO NOT pm me for support!

Imago


Kindred

BTW 2.1.x uses ALL UTF8. There are no ISO files in 2.1.x
Сл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."

Advertisement: