- Posts: 11
COMMUNITY FORUM
No image upload
- Bernd
-
Topic Author
- Offline
- New Member
Pierre Cornelissen said:Where does K2 save the Category and Item Image Files?
Bernd said:Yes and check the files. The files must be your FTP user not wwwrun or nobody. Ala Makota said:Do you mean wrong chmod on image folder? Still I can't figure it out... Bernd said:wwwrun is a preference/user problem on a host. Check your files on your server.
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- Gijs Scholman
-
- Offline
- New Member
- Posts: 1
Please Log in or Create an account to join the conversation.
- Gideon Larionov
-
- Offline
- New Member
- Posts: 3
Also using the latest K2 v2.4.1 and Joomla 1.5.20.
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
The quick fix is to edit /administrator/components/com_k2/lib/class.upload.php. Go to the init() function, and change the following variables from true to false:
$this->mime_fileinfo = false; // MIME detection with Fileinfo PECL extension
$this->mime_file = false; // MIME detection with UNIX file() command
$this->mime_magic = false; // MIME detection with mime_magic (mime_content_type())
You are 'SUPPOSED' to be able to override these settings in the calling script, however, because of a fundamental flaw in the design, it doesn't actually work :^)
I have documented the flaw in another post, but the above should at least get you working!
Please Log in or Create an account to join the conversation.
- Gideon Larionov
-
- Offline
- New Member
- Posts: 3
Let`s try it out :-)
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
Gideon Larionov said:
Nick Texidor said:For those people having problems with the uploading of files, and have already ruled out a problem with permissions, I have a solution....
Let`s try it out :-)
Please Log in or Create an account to join the conversation.
- Gideon Larionov
-
- Offline
- New Member
- Posts: 3
Nick Texidor said:So, did it work? :^)
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
- Posts: 8743
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
Pierre Cornelissen said:Since as an admin I upload the images to the folder via cPanel, but have not tried this one; what will happen if an upgrade from K2 arrives - will they have fixed this problem in the meantime?
Please Log in or Create an account to join the conversation.
- Angelo
-
- Offline
- New Member
- Posts: 2
thx and sry for my bad english
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
Are you looking in the /components/com_k2/lib folder by any chance? It should be in the /administrator/components/com_k2/lib folder.
Angelo said:big hello from Greece!!!this is my first post here.my poblem is i join on k2 folder/lib but i dont have a file name class.upload.php the only file on folder is recaptchalib.php...can any one help me pls??? thx and sry for my bad english
Please Log in or Create an account to join the conversation.
- Angelo
-
- Offline
- New Member
- Posts: 2
Angelo said:big hello from Greece!!!this is my first post here.my poblem is i join on k2 folder/lib but i dont have a file name class.upload.php the only file on folder is recaptchalib.php...can any one help me pls??? thx and sry for my bad english
Please Log in or Create an account to join the conversation.
- Vicente Gavara
-
- Offline
- New Member
- Posts: 4
Please Log in or Create an account to join the conversation.
- Smart Guy Computing
-
- Offline
- New Member
- Posts: 9
Nick Texidor said:For those people having problems with the uploading of files, and have already ruled out a problem with permissions, I have a solution....
The quick fix is to edit /administrator/components/com_k2/lib/class.upload.php. Go to the init() function, and change the following variables from true to false:
$this->mime_fileinfo = false; // MIME detection with Fileinfo PECL extension
$this->mime_file = false; // MIME detection with UNIX file() command
$this->mime_magic = false; // MIME detection with mime_magic (mime_content_type())
You are 'SUPPOSED' to be able to override these settings in the calling script, however, because of a fundamental flaw in the design, it doesn't actually work :^)
I have documented the flaw in another post, but the above should at least get you working!
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
Mark Bolden said:Hi Nick! I just wanted to say that I was having the exact same problem and your solution worked like a charm! thanks a million!!!
Please Log in or Create an account to join the conversation.
- ledouble
-
- Offline
- New Member
- Posts: 7
I tried the following solution kindly proposed by Nick Texidor (below), but it don't work. Did someone have a solution to enable the upload of images in the "Edit Item" - Image tab. Thank you in advance for your Help. Bill
$this->mime_fileinfo = false; // MIME detection with Fileinfo PECL extension
$this->mime_file = false; // MIME detection with UNIX file() command
$this->mime_magic = false; // MIME detection with mime_magic (mime_content_type())
Please Log in or Create an account to join the conversation.
- Nick Texidor
-
- Visitor
If changing the MIME type settings didn't work for you, there are a couple of other things you can try... first off, are the permissions on the /media/k2 folder set correctly? I usually set /media/k2 and all sub-directories to 777 to make sure that's not the problem.
If they're all ok, the other thing you could try is displaying the upload log to see if it shows any kind of problem: Edit the file /administrator/components/com_k2/models/item.php, and search for //image. About 9 or 10 lines down from that, you should see the following:
$handle = new Upload($image);
under that, add:
echo $handle->log;
Next, try and add an image to an item. You should see some debug output on the screen Have a quick scan and see if it shows anything obvious. If you're not sure, send me the text in a PM and I'll have a look for you.
Hope this helps a little
N
bill said:Hi all,
I tried the following solution kindly proposed by Nick Texidor (below), but it don't work. Did someone have a solution to enable the upload of images in the "Edit Item" - Image tab. Thank you in advance for your Help. Bill
$this->mime_fileinfo = false; // MIME detection with Fileinfo PECL extension
$this->mime_file = false; // MIME detection with UNIX file() command
$this->mime_magic = false; // MIME detection with mime_magic (mime_content_type())
Please Log in or Create an account to join the conversation.
- ledouble
-
- Offline
- New Member
- Posts: 7
Thank you very much for the suggestions and tips. I apologize but I had no time to try out your all the tips you gave to me. I will do it tomorrow and give you a feedbak about the results of it.
Thanks again, ciao
Bill
Nick Texidor said:
No worries... glad it's all working for you! :^) Mark Bolden said:Hi Nick! I just wanted to say that I was having the exact same problem and your solution worked like a charm! thanks a million!!!
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Remember check file names, turn off sef, set error reporting to highest, power must be plugged in because i can see the screen! been there, done that
Please Log in or Create an account to join the conversation.