Keyword

Content Module Image resizing

More
14 years 4 weeks ago #71594 by Joackim Devaud
Replied by Joackim Devaud on topic Content Module Image resizing
Hello Nick,

First, thank you for your solution... ;-)

I've changed all the line in all the files and i still have an error "file error, please try again"...
Could you upload all the files you've changed? It will be very usefull for me...

Thx for your answer...

Best Regards

Nick Texidor said:Hey Mongo, sorry to send yet another message. I forgot to mention that there are 4 files in K2 that need changing if you want them all to work properly:
/administrator/components/com_k2/models/category.php
/administrator/components/com_k2/models/item.php
/administrator/components/com_k2/models/user.php
/plugins/user/k2.php

In those files, simply replace all occurrences of:

$handle = new Upload($file);

with:

$handle = new upload();
$handle->mime_fileinfo = false;
$handle->doUpload($file);

and everything should be sweet! :^)



Mongo said:Wow You Are The Man!! Thank you dude I just thought people just saying I was crazy was true!.. I mean I hide it well but hehe.. But thank you for looking into such an old thread. I really appreciate it and i'm now using your file.

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

  • Nick Texidor
  • Nick Texidor's Avatar
  • Visitor
14 years 4 weeks ago #71595 by Nick Texidor
Replied by Nick Texidor on topic Content Module Image resizing
Hi Joackim,

I guess the first thing to do is actually check that your error is related to the MIME type checking. Looking at the error message you mentioned, and going through the uploader class code, It looks like the error is more related to the upload of the file.

Anyway, there is some debug code in the upload class that may help out. Which section are you uploading from? If it's adding an image to a K2 item, then open the /administrator/components/com_k2/models/item.php file. Search for $handle, and it should take you down to the code that fires off the upload script. Just before the if ($handle->uploaded) check, try putting in echo $handle->log and see if there are any helpful messages there.

If you're still having problems, send me a private message and we can take this private to try and help you out.

All the best
Nick



Joackim Devaud said:Hello Nick,
First, thank you for your solution... ;-)

I've changed all the line in all the files and i still have an error "file error, please try again"...
Could you upload all the files you've changed? It will be very usefull for me...

Thx for your answer...

Best Regards

Nick Texidor said:Hey Mongo, sorry to send yet another message. I forgot to mention that there are 4 files in K2 that need changing if you want them all to work properly: /administrator/components/com_k2/models/category.php
/administrator/components/com_k2/models/item.php
/administrator/components/com_k2/models/user.php
/plugins/user/k2.php

In those files, simply replace all occurrences of:

$handle = new Upload($file);

with:

$handle = new upload();
$handle->mime_fileinfo = false;
$handle->doUpload($file);

and everything should be sweet! :^)



Mongo said:Wow You Are The Man!! Thank you dude I just thought people just saying I was crazy was true!.. I mean I hide it well but hehe.. But thank you for looking into such an old thread. I really appreciate it and i'm now using your file.

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

More
14 years 4 weeks ago #71596 by Joackim Devaud
Replied by Joackim Devaud on topic Content Module Image resizing
Hello Nick,

Thank you for your fast answer.
I've tried to add echo $handle->log but nothing appears... no error and i still can't upload any images...
Do you have an id?

I'm on a french joomla 1.15.20 with K2 2.3

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

  • Nick Texidor
  • Nick Texidor's Avatar
  • Visitor
14 years 4 weeks ago #71597 by Nick Texidor
Replied by Nick Texidor on topic Content Module Image resizing
Hi Joackim,

The error you mentioned, 'File error. Please try again.' only appears in two places in the upload class. They both appear just after the check to see if a valid file has been passed to the routine. My fixes, previously mentioned, really only apply to the MIME type checking which is done later in the script. So I'm not sure the changes I made are going to help here. I guess the first thing we need to do is work out at which call to the upload class it fails. Could you confirm this happens when you add an image to the K2 item via the back-end? Or is it happening somewhere else? What is the filename you are entering? Does it happen to contain any odd characters, spaces maybe?

It's going to be quite hard to debug this via the forum, so if you'd like a bit of help, then lets take this off to private messages or email, and go from there?

All the best
Nick


Joackim Devaud said:Hello Nick,
Thank you for your fast answer.
I've tried to add echo $handle->log but nothing appears... no error and i still can't upload any images...
Do you have an id?

I'm on a french joomla 1.15.20 with K2 2.3

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

More
14 years 4 weeks ago #71598 by Joackim Devaud
Replied by Joackim Devaud on topic Content Module Image resizing
did you received my private messages?

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


Powered by Kunena Forum