News:

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

Main Menu

Re: Decrypt attachment files

Started by fishoaus, August 31, 2021, 07:28:23 AM

Previous topic - Next topic

fishoaus

how do i de decrypt images have been stuck for ages after up grade months back wonder if my forum attachments are bugged only show up as save then open image, no image as thumbnails view now, would this work help

https://www.simplemachines.org/community/index.php?topic=367382.0

fishoaus

Quote from: fishoaus on August 31, 2021, 07:28:23 AMhow do i de decrypt images have been stuck for ages after up grade months back wonder if my forum attachments are bugged only show up as save then open image, no image as thumbnails view now, would this work help

https://www.simplemachines.org/community/index.php?topic=367382.0

looks like i"ll have to wipe my forum & start again, as i can't figure it out

Arantor

Whoa, hold on there before you go starting over.

What, exactly, is your situation? You have some attachments - do you have the database for those attachments? Did you move the files between servers at some point?

It also might have helped if you'd made your own topic...

Aleksi "Lex" Kilpinen

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

Attachments aren't encrypted, file names are hashed.  It's not too difficult to restore original file names, but attachments won't work if you do.  That's not your problem.

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

                                     - R. Waters

shawnb61

I suspect you need to doublecheck your attachments configuration.  Repair_settings.php may help.

Check all attachments settings, folders, etc.  Confirm you still have the rows in your attachments table.  If the files are still there, and the rows are in the attachments table, you can likely still recover.


If OTOH you really just want to recover the files, you need some way to rename them back.  I've done this before, instructions here:
https://www.simplemachines.org/community/index.php?msg=3927825
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Arantor

This is why I'm asking if the OP moved files... say with FileZilla :(

fishoaus

#7
i had forum up graded by some one else, can see attachments but only by saving not by thumb nails, Had a few extra mods installed & can save them all by ftping back to my computer no viewing on my pc, only view from forum is by click on paper clip open with my default image software if that makes sense

fishoaus

#8
Quote from: Arantor on September 05, 2021, 07:29:10 AMWhoa, hold on there before you go starting over.

What, exactly, is your situation? You have some attachments - do you have the database for those attachments? Did you move the files between servers at some point?

It also might have helped if you'd made your own topic...

No not moved between servers just different portal, media gallery i just had to up grade as my forum was way out dated, i just bugged it up from start i say, then had some one else try pic up the pieces, say images not moved or saved properly not sure, yes still have data base forum is still running

fishoaus

Quote from: Arantor on September 06, 2021, 02:47:54 AMThis is why I'm asking if the OP moved files... say with FileZilla :(


i did use filezilla, you have helped me before at dezinerstudio many years ago adding code to new balance, i also use to use your media gallery before i up graded

Arantor

That's kind of what I'm wondering about: FileZilla can and does damage file attachments in SMF if not explicitly configured not to. :(

Sir Osis of Liver

If the images are viewable by any means (apparently they are), they haven't been damaged by FZ ascii d/l, which corrupts the files and makes them unuseable.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fishoaus

Quote from: shawnb61 on September 06, 2021, 01:01:21 AMI suspect you need to doublecheck your attachments configuration.  Repair_settings.php may help.

Check all attachments settings, folders, etc.  Confirm you still have the rows in your attachments table.  If the files are still there, and the rows are in the attachments table, you can likely still recover.


If OTOH you really just want to recover the files, you need some way to rename them back.  I've done this before, instructions here:
https://www.simplemachines.org/community/index.php?msg=3927825

I am not sure how to do this But images are still all there & i have downloaded them in binary can view a lot of them on pc & in forum but only shows the paper clip on forum , open with my default image viewer same on pc right click open with

shadav

ok so attachments work, images are fine it's just they aren't being displayed in the post
sounds to me more like your theme's display.template.php or in your sources folder the display.php is messed up
what version of smf is this
what theme are you using
does this do this with the default theme
what mods do you have installed

also
in your admin under forum then under Attachments and Avatars and then attachment settings
is this box checkmarked?
Display image attachments as pictures under post

Sir Osis of Liver

Do all attachments fail to load?  Can you attach pics successfully to new posts?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fishoaus

#15
Quote from: Sir Osis of Liver on September 07, 2021, 06:12:59 PMDo all attachments fail to load?  Can you attach pics successfully to new posts?

yes can attach  but fail to display image, only paper clip to open with default image viewer

fishoaus


fishoaus

Quote from: shadav on September 07, 2021, 09:09:34 AMok so attachments work, images are fine it's just they aren't being displayed in the post
sounds to me more like your theme's display.template.php or in your sources folder the display.php is messed up
what version of smf is this
what theme are you using
does this do this with the default theme
what mods do you have installed

also
in your admin under forum then under Attachments and Avatars and then attachment settings
is this box checkmarked?
Display image attachments as pictures under post

yes images attachments  box checked &  avatars, yes display  image attachments as pictures under posts checked

smf 2.0.18 theme dzinersutdio theme newbalance old as now, default theme does same no display images


mods

1.    Simple Audio Video Embedder    6.0.4    August 31, 2021, 08:59:55 PM.   
2.    TinyPortal    2.1.0    August 30, 2021, 10:06:56 PM.   
3.    Contact Page    5.0.1a    May 20, 2021, 08:40:17 PM.   
4.    Sortable Packages (and Installed Time)    1.3.5    May 19, 2021, 02:51:13 AM.   
5.    Levertine Gallery    1.1.1    April 30, 2021, 09:23:32 PM.

Sir Osis of Liver

Looking at your pic test post, link to attachment is correct, download works, image file is fine.  What's not working is 'Display image attachments as pictures under post' setting.  If it actually is checked, then you probably have a mod problem.  Only one I don't recognize is Levertine Gallery, you can try uninstalling that.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

I don't think Levertine really does anything about attachments in posts, so that one seems unlikely. Though it does add a lot of permissions handling regarding the gallery.
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

shadav

can you upload your
theme's display.template.php and in your sources folder the display.php
as attachments
if your theme doesn't have the display.template.php then it uses the one in the default folder
just to compare them with default files and see if there might be something wrong there
but yeah nothing that you posted of the mods above should have messed anything up

with so few mods I'd say just download fresh files of 2.0.18 and upload them overwriting your current files and then reinstall themes and mods
however the themes you use I'm fairly sure are not found anymore and well are outdated

Arantor

Quote from: Aleksi "Lex" Kilpinen on September 08, 2021, 01:18:38 PMI don't think Levertine really does anything about attachments in posts, so that one seems unlikely. Though it does add a lot of permissions handling regarding the gallery.

Correct, it does nothing to this at all.

Sir Osis of Liver

Haven't had any problems with DS themes in 2.0.18.  Don't have newbalance, that may have been a paid theme.  But do as shadav suggested -

https://wiki.simplemachines.org/smf/How_to_upload_a_fresh_set_of_files

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

                                     - R. Waters

Arantor


fishoaus

 Levertine Gallery 1.1.1, was made by a a well known smf legend, but i am not sure if there real active in doing stuff on here now,
 

Arantor

I'm not developing the gallery. I haven't in years.

fishoaus

Quote from: Arantor on September 09, 2021, 04:29:45 AMYes, newBalance was a paid theme.

yes i did pay for it many years ago, when dzinerstudio was active, you even helped me with the code to put ads under nav menu in newbalance may still have your code some where  so it could of change ads after a time frame some where i had a different user name on there the owner  wife desinged new post no neww post avatars for me as well

fishoaus


fishoaus


fishoaus

I still have no luck would you call this forum a ride off with attachments, images & start again?????

Sir Osis of Liver

Have you tried uploading clean files?  If you can pm cpanel access I'll have a look tonight.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fishoaus

Quote from: Sir Osis of Liver on September 17, 2021, 12:59:00 PMHave you tried uploading clean files?  If you can pm cpanel access I'll have a look tonight.

Have PM,ed access

Sir Osis of Liver

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

                                     - R. Waters

Sir Osis of Liver

This is a strange one.  Attachment settings are correct, pics can be d/l'd from link under post and displayed in image editor.  Database setting can be toggled on/off as per normal.  Have a clean 2.0.18 install running in subdir, imported prod database, old attachments aren't displayed, new ones display correctly.  If I d/l image from prod forum that is not displayed, it doesn't display on test forum until it's opened in image editor and saved, it then displays correctly on test forum, not prod forum.  Looks like a mod is affecting the files. 

Installed mods:
  Simple Audio Video Embedder 6.0.4
  TinyPortal 2.1.0
  Contact Page 5.0.1a
  Sortable Packages (and Installed Time) 1.3.5
  Levertine Gallery 1.1.1

AEVA was installed at one time, iirc it was problematic and removed from mod site, wondering if there may be some remnant code that's damaging uploads.  Next thing to do is clean install on prod forum, but there'a a lot of custom work on prod theme.  Main concern is if attachments are damaged, is there any way to fix 460 files in bulk. 

I'm beat, will get back to this tomorrow night.  If anyone has any ideas, would be appreciated.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shadav

I have all of those mods installed without said issue, except for levertine gallery though I doubt that would be the cause and I never used aeva but maybe it caused issues

if opening and saving the files seems to work, maybe use an image optimizer and see if that does the trick
you can use this one for bulk uploads
kraken.io/web-interface

Arantor

AEVA never touched the attachments system.

Sir Osis of Liver

Sadly, my Logitech solar keyboard seems to have died since last night.  Can't do much with this onscreen keyboard, will have to look through my vast collection of computer stuff and see if I can find a keyboard that works with this computer.

<sigh>
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Sir Osis of Liver

 :)  It's come back to life, just needed a little light.

Ok, here's what's happening tonight.  Attach a clean image to a post (bushwick.jpg), it displays the link, no image.  When I click on the link I can d/l the image, it displays normally in image editor (bushwick2.jpg).  Attach it to post in test forum, no go.  Save it in editor as bushwick3.jpg, it attaches and displays normally in test forum, not prod forum.  Let's see what it does here.

As you can see, the image that was uploaded/downloaded to/from prod forum (bushwick2.jpg) does not display here, either.  It works after it's been d/l'd and saved in image editor (bushwick3.jpg).  bushwick2.jpg loads normally in editor, but forum can't display it.

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

                                     - R. Waters

fishoaus

i"ll down a few images open in editor then re save then up load  to my forum for a test from me

Sir Osis of Liver

FYI anyone following this topic, attachment glitch was caused by code in index.template.php that OP used to add his own copyright to footer -


function template_body_below()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;

            echo '
                </div>
            </div>';

        // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
        echo '
            <div id="footer">
                <ul class="reset">
                    </li>              
                    <li>', theme_copyright(), '</li>
                                                                                <li class="copyright "><strong><style scoped>
.blackText {color:black;}
</style>
<p class="blackText">© 2021 BREAMALLIANCE.COM</p>
</div>
</p>
<a> </ul>
                </ul>';

                // Show the load time?
                if ($context['show_load_time'])
                echo '
                    <p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';
        echo '
            </div>
        </div>
    </div>
</div>';
}


Replaced it with this, solved the problem -


function template_body_below()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;

            echo '
                </div>
            </div>';

        // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
        echo '
            <div id="footer">
                <ul class="reset">
                    <li>', theme_copyright(), '</li>
                    <li style="color: black; font-weight: bold;">&copy; 2021 BREAMALLIANCE.COM</li>
                </ul>';

                // Show the load time?
                if ($context['show_load_time'])
                echo '
                    <p>', $txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</p>';

        echo '
            </div>
        </div>
    </div>
</div>';
}


Don't have remotest clue why original code was damaging attachments.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fishoaus

Sir Osis of Liver, thank you for fixing my forum, I would of never worked out such a small edit would do that, if you lived close I would shout you a beer or 3, thank you again for that!

Shambles

Quote from: fishoaus... I would shout you a beer or 3 ...

Many people do, hence the name "Sir Osis of Liver"  8)

Sir Osis of Liver

Did someone mention beer?

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

                                     - R. Waters

shawnb61

Quote from: Sir Osis of Liver on October 07, 2021, 06:12:39 PMDon't have remotest clue why original code was damaging attachments.

This sounds very similar to some earlier issues, in which stray whitespace characters were getting added to the bottom of attachments, corrupting them...  This was in turn caused by stray whitespace in the source code that had been added inadvertently.

One old example:
https://www.simplemachines.org/community/index.php?msg=3938086
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

But why would anything in index template affect file uploads, it's strictly presentation?  Did a hex dump on bad file, completely different from original file, but no whitespace up top.  And it loads normally in image editor.  If you look at attachments to my previous post, all the same image but second one was attached to post on OP's forum and d/led from attachment link.  It's normal in editor but won't display on his forum or here.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

fishoaus

if you can get a australian beer & like a dry beer if you can get it?, lol try tooheys extra dry top drop ;-)

Advertisement: