News:

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

Main Menu

Show photos

Started by FOxsis, May 13, 2025, 04:08:36 AM

Previous topic - Next topic

FOxsis

hello. please tell me why the files attached to the comments when switching from smf 2.0 to smf 2.1.4 (standard template), the error File not found appears. Example: https://forum.expert-cm.ru/index.php?action=dlattach;attach=29249

Doug Heffernan

Quote from: FOxsis on May 13, 2025, 04:08:36 AMhello. please tell me why the files attached to the comments when switching from smf 2.0 to smf 2.1.4 (standard template), the error File not found appears. Example: https://forum.expert-cm.ru/index.php?action=dlattach;attach=29249

Try running the script attached to the following post and see if it would help.

https://www.simplemachines.org/community/index.php?topic=583745.msg4135957#msg4135957

FOxsis

and how do they use this file?

Doug Heffernan

Quote from: FOxsis on May 13, 2025, 09:22:17 AMand how do they use this file?

Do you mean how to use that file? If so, download it from the post that I linked in my previous reply, upload it to your forum root folder and run it by pointing your browser to it.

Sir Osis of Liver

Here is an updated version of the script.  It works on /attachments.  If you have more than one attachments directories I have additional scripts, or you can easily modify this one if you know how.


When in Emor, do as the Snamors.
                              - D. Lister

FOxsis

I'm a kettle, please help me with running the script, I've changed the bat to jpg, uploaded it to the root, launched it, but no changes (

FOxsis

Quote from: FOxsis on May 14, 2025, 01:08:22 AMI'm a kettle, please help me with running the script, I've changed the bat to jpg, uploaded it to the root, launched it, but no changes (
help me please

Aleksi "Lex" Kilpinen

We are all volunteers here, so please understand support may not be available in real time.

Then, it is a php file, not a bat or an image. A php file should be executable as is.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

FOxsis

Quote from: Aleksi "Lex" Kilpinen on May 14, 2025, 04:46:01 AMWe are all volunteers here, so please understand support may not be available in real time.

Then, it is a php file, not a bat or an image. A php file should be executable as is.
it edit
if (strpos($file, '.jpg') === false) {
       rename($file, $file . ".jpg");
       $fixed = $fixed +1;

Aleksi "Lex" Kilpinen

Well, it should be .dat - if that's what you ran, you probably just made things worse. Why did you edit it at all?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

FOxsis

Quote from: Aleksi "Lex" Kilpinen on May 14, 2025, 07:47:59 AMWell, it should be .dat - if that's what you ran, you probably just made things worse. Why did you edit it at all?
I ran this file without changes, but nothing happened.

Aleksi "Lex" Kilpinen

Before or after you ran the edited one?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sir Osis of Liver

Look in your /attachments directory, do all the files have a .dat extension?

Like this -

   03707e33f8bf1d1f347b671d7739a1bd90475c10.dat


When in Emor, do as the Snamors.
                              - D. Lister

FOxsis

Quote from: Sir Osis of Liver on May 14, 2025, 12:54:58 PMLook in your /attachments directory, do all the files have a .dat extension?

Like this -

   03707e33f8bf1d1f347b671d7739a1bd90475c10.dat



I ran the file to rename to bat and jpg editable file and not. php is working, but without changes. In both cases, the attachments folder remained unchanged, and all files without extensions remained the same.

FOxsis

I gave full rights to the folder, the php extension bat was added, but still the same error File not found when opening a jpg photo

FOxsis

sorry for the carelessness, I should have added the dat extension, not bat. now I have everything like this((
https://dropmefiles.com/iuJqj

Illori

it should be .dat not .bat.dat.

FOxsis

Quote from: Illori on May 15, 2025, 05:48:03 AMit should be .dat not .bat.dat.
I already figured that out, but it's too late, now I don't know how to remove the extension, or rather.bat.dat

Kindred

Did you take a backup of your site before upgrading?
restore the backup and then run the upgrader once more

Also, when we gave you a script and said "run this" why did you feel the need to change the script?  As written it would do exactly what was needed. Now you have caused yourself a whole bunch of extra work.
'
Сл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."

Sir Osis of Liver

I have no idea what you've done or how you did it, but the script I posted does not add .dat extension to files that already have it.  If you have files with a .bat or .bat.dat extension you screwed with the script and made a mess.  I have another script that removes .dat extension, it can be modified to remove .bat or .bat.dat, but I hesitate to post it because you obviously don't know wtf you're doing.

When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: