Skip to main content
Topic: Attacment problem (zip, rar) (Read 2941 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Attacment problem (zip, rar)

Hi,

I think it was after 1.1.2 update

I've just realized

link click does not download the file

1.png

  2.png

test.zip
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #1

elkarte.net  test I added the first message zip file

3.png
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #2

Indeed a bug.
I saw the topic yesterday night and today I forgot about it... :-\

Let me check a few moments if I can find the bug and propose a fix.
Ahh... got it: the lightbox tries to show the attachment as an image, but since it is not and Elk sends a download header, it "fails" silently without giving anything to download.

Well, the easiest solution right now is not to "insert" non-image attachments inline.
I'll see if I can figure out a way for the lightbox to "switch" to download when necessary.
Bugs creator.
Features destroyer.
Template killer.

Re: Attacment problem (zip, rar)

Reply #3

Strange is that the first time when I opened this topic and clicked on the zip file asked me where to save the file. Then I watched the other attachments in this topic and I clicked again on the zip file I wasn't able to download the file.
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #4

Interesting @radu81 maybe it was already around before and nobody noticed it? Dunno.
Anyway, this should work: in topic.js (themes/default/scripts) you should have:
Code: [Select]
					setTimeout(function () {
ajaxIndicatorOff();
closeLightbox();
}, 1500);
at line 916.
Change it to:
Code: [Select]
					setTimeout(function () {
ajaxIndicatorOff();
closeLightbox();
window.location = link.href;
}, 1500);
That is probably a good default behaviour: if something fails in showing the URL inside the lightbox, just try the good old download.
Bugs creator.
Features destroyer.
Template killer.

Re: Attacment problem (zip, rar)

Reply #5

It works ;)
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #6

This evening I'll push 1.1.3 live here (it was not urgent because anyway we are not in the conditions to trigger the issue), then I'll add this one too.
Bugs creator.
Features destroyer.
Template killer.

Re: Attacment problem (zip, rar)

Reply #7

Hi,

Is there a solution? 

thanks
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #8

Emanuele posted the solution 2 posts above and t works 
sorry for my bad english

Re: Attacment problem (zip, rar)

Reply #9

Replace topic.js test ok.  click the link and wait for a while to download the file .  How an icon looks instead of "asd"   or file name instead of icon  

 thanks @emanuele

as for me should not be  insert compressed files, only picture files insert


Last Edit: March 21, 2018, 09:42:09 am by gevv
sorry for my bad english

 

Re: Attacment problem (zip, rar)

Reply #10

Have a look at this https://www.elkarte.net/community/index.php?topic=5120.msg36311#msg36311

you need to edit the topic.js file, search for that part of code and change it like mentioned in the post above. After this edit you can also place inline zip attachments.
sorry for my bad english