Keyword

K2 simply won't upload attachments on Windows version of Apache

  • Nikola
  • Nikola's Avatar Topic Author
  • Offline
  • New Member
More
3 years 21 hours ago - 3 years 21 hours ago #178404 by Nikola
Hi everyone,

I've had this problem for more than a year now – in all honesty, I come back to it from time to time, but obviously I never spend enough time trying to solve it, and every time I do come back to it, I have to restart my analysis from scratch. The problem started happening with 2.10.3. I also tried solving the problem with numerous 2.10.4 dev updates which all work perfectly – except with this!

The problem is pretty much straighforward: whenever I try to add an attachment to a k2 item, the system acts as if everything went OK. In reality, the file is not moved to media/k2/attachment, and the database entry is created, but it is incomplete (the "filename" attribute is empty, but the "Title attribute" contains the actual filename). The fastest workaround so far is to initiate the upload in order to create/update database entries in k2_items and k2_attachments, move the files to server manually, and finally edit the database (update the "filename" attribute in k2_attachments) using PHPMyAdmin.

I opened a similar topic more than a year ago and the team told me it had something to do with MIME types when using Apache under MS Windows. I tried to identify the problem and fix it server side, but was unable to. In this case I actually had access to server's configuration files, but several of my clients are using old K2 on Windows hosting and can't update because of this problem.

I have tried updating to the latest dev from Github several times already (last time it was 3 days ago), to no success. I obviously have no problems using dev versions, therefore modifying core files won't be a problem. If anyone has had similar difficulties, any input would be most welcome.

Note: I've also updated Apache several times, tried switching from PHP 7.2 to 7.3 to 7.4 to 8 ... but nothing solved my problem!
Last edit: 3 years 21 hours ago by Nikola.

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

More
3 years 20 hours ago #178405 by JoomlaWorks
Please try v2.10.4 (dev) from: getk2.org/downloads/?f=K2_Development_Release.zip

It's perfectly safe to upgrade.

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

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

  • Nikola
  • Nikola's Avatar Topic Author
  • Offline
  • New Member
More
3 years 18 hours ago #178407 by Nikola
Hey Fotis, thanks for your reply!

Unfortunately, I've already tried it, and the same thing keeps happening (as I said, I love to experiment with dev releases, as they always work without any bugs for me, and I love to test new features).

I forgot to mention, Joomla's core Media Manager uploads without any problems, your own SIG uploads images and ZIP archives without problems ... the only component causing any problems, unfortunately, is K2/attachments :(

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

More
2 years 11 months ago #178454 by JoomlaWorks
I don't remember if I've updated the process for attachments as well. If I haven't I'll note it down to do so.

In the meantime, use the "browse server" option to upload attachments through the K2 media manager and then simply select them to be added as attachments. This should work.

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

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

  • Nikola
  • Nikola's Avatar Topic Author
  • Offline
  • New Member
More
2 years 11 months ago #178605 by Nikola
Hey Fotis,

Thanks for your reply, sorry I missed it. And yes, your solution worked like a charm, as expected!

The only problem I have is - I'd like to upload to media/k2/attachments and just continue working with that folder once you update the code. Howerer, the "browse server" button only lets me browse the "images" folder and below. I didn't want to screw up any settings or existing links by changing anything, but is it possible to change this? As I mentioned before, hardcoding is also an option for me.

Thank you once again!

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

More
2 years 11 months ago #178637 by JoomlaWorks
You can't browse the K2 attachments folder. Uploading a file or browsing the server's /images/ folder has the same effect: attachments will be copied into /media/k2/attachments/ once you save the item.

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

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


Powered by Kunena Forum