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!
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!
Edited 5 years 7 months ago by Nikola