Keyword

bUG? Error k2 attachment renames a file when uploaded

  • Vassilis
  • Vassilis's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #77229 by Vassilis
Hi,
everytime i upload a file (attachment) like .doc or .rar, .zip etc the system renames the file to something like file.doc.txt instead of file.doc

I am using the latest build of K2.

Please Log in or Create an account to join the conversation.

  • Vassilis
  • Vassilis's Avatar Topic Author
  • Offline
  • New Member
More
14 years 8 months ago #77230 by Vassilis
anyone?

Please Log in or Create an account to join the conversation.

  • kabeza
  • kabeza's Avatar
  • Offline
  • Senior Member
  • www.beza.com.ar
More
14 years 2 months ago #77231 by kabeza
Hi Vassilis
I'm having the same issue. Didn't try with the latest version 2.3, but I have to fix the already installed 2.2

Look:


If anyone can help us with this...

Custom Joomla templates<br />www.beza.com.ar

Please Log in or Create an account to join the conversation.

More
14 years 2 months ago #77232 by Lefteris
Hi. This is a mime detection problem. It seems that the class.upload.php fails to detect the correct mime type on your system. You can try:
1. Update K2 to it's latest version. It also updates the specific class to it's latest version.
2. Upload the file from a different browser.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • kabeza
  • kabeza's Avatar
  • Offline
  • Senior Member
  • www.beza.com.ar
More
14 years 2 months ago #77233 by kabeza
Tried with Firefox, Opera and Chrome. All with same result
I think I'll try upgrading to 2.3

Lefteris Kavadas said:Hi. This is a mime detection problem. It seems that the class.upload.php fails to detect the correct mime type on your system. You can try: 1. Update K2 to it's latest version. It also updates the specific class to it's latest version.
2. Upload the file from a different browser.

Custom Joomla templates<br />www.beza.com.ar

Please Log in or Create an account to join the conversation.

  • Vassilis
  • Vassilis's Avatar Topic Author
  • Offline
  • New Member
More
14 years 2 months ago #77234 by Vassilis
Hi Lefteris,
i still have teh same problem.
In every K2 site i create.
From every browser and with the latest version...
Any solution plz?

Lefteris Kavadas said:Hi. This is a mime detection problem. It seems that the class.upload.php fails to detect the correct mime type on your system. You can try: 1. Update K2 to it's latest version. It also updates the specific class to it's latest version. 2. Upload the file from a different browser.

Please Log in or Create an account to join the conversation.

  • kabeza
  • kabeza's Avatar
  • Offline
  • Senior Member
  • www.beza.com.ar
More
14 years 2 months ago #77235 by kabeza
I finally did:

1- backup to jos_k2_*** tables in phpmyadmin
2- backup media/k2 folder in ftp
3- removed k2 v2.2
4- installed k2 v2.3
5- restored sql backup from point 1 (restored the original jos_k2_*** tables)
6- removed .txt from each media/k2/attachtments file (you can do this in your pc with a multiple renamer software)
7- uploaded k2 folder to media/k2 in ftp (overwrote everything)
8- removed .txt manually from each record in the jos_k2_attachtments table

It is a long and kinda complicated process, but I guess it is working fine now
PS: Software still shows v.2.2 in the control panel... I guess we'll have to do another upgrade soon


Vassilis said:Hi Lefteris, i still have teh same problem.
In every K2 site i create.
From every browser and with the latest version...
Any solution plz?

Lefteris Kavadas said:Hi. This is a mime detection problem. It seems that the class.upload.php fails to detect the correct mime type on your system. You can try: 1. Update K2 to it's latest version. It also updates the specific class to it's latest version. 2. Upload the file from a different browser.

Custom Joomla templates<br />www.beza.com.ar

Please Log in or Create an account to join the conversation.

  • Vassilis
  • Vassilis's Avatar Topic Author
  • Offline
  • New Member
More
14 years 2 months ago #77236 by Vassilis
Hi Enrique,
i think i find a solution that works.

In file: class.upload.php (inside &gt;&gt; \administrator\components\com_k2\lib)
Arround the line: 2230
I take this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_pathname);
and change it to this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_name);

After that it works.

But it is very strange why in the v2.3 this isn't fixed :/

Thx for the help anyway ;)

Please Log in or Create an account to join the conversation.

  • kabeza
  • kabeza's Avatar
  • Offline
  • Senior Member
  • www.beza.com.ar
More
14 years 2 months ago #77237 by kabeza
Wow
It was just a so simple hack, would love to have known before lol
Thanks!

Vassilis said:Hi Enrique, i think i find a solution that works.

In file: class.upload.php (inside &gt;&gt; \administrator\components\com_k2\lib)
Arround the line: 2230
I take this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_pathname);
and change it to this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_name);

After that it works.

But it is very strange why in the v2.3 this isn't fixed :/

Thx for the help anyway ;)

Custom Joomla templates<br />www.beza.com.ar

Please Log in or Create an account to join the conversation.

More
13 years 11 months ago #77238 by Johnny Violent
Replied by Johnny Violent on topic bUG? Error k2 attachment renames a file when uploaded
Hm, that resolved the bug - unfortunately by updating to 2.4.1 the error occurs again. And editing the code results in a blank attachment filename. Any ideas?

Thx in advance,
Andi.

Enrique Becerra said:Wow It was just a so simple hack, would love to have known before lol
Thanks!

Vassilis said:Hi Enrique, i think i find a solution that works.
In file: class.upload.php (inside &gt;&gt; \administrator\components\com_k2\lib)
Arround the line: 2230
I take this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_pathname);
and change it to this &gt;&gt;
$this-&gt;file_src_mime = mime_content_type($this-&gt;file_src_name);

After that it works.

But it is very strange why in the v2.3 this isn't fixed :/

Thx for the help anyway ;)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum