Author Topic: [FIXED] Cannot upload images + mimetype error + slug error  (Read 8665 times)

Razva

  • Jr. Member
  • **
  • Posts: 55
[FIXED] Cannot upload images + mimetype error + slug error
« on: October 03, 2011, 15:55:32 pm »
Hi,

We're using the latest SVN.

Please take a look at http://www.semineemures.ro/produse/sobe/sobe-lemne - click the "image", you'll see some "Matrix-style" text. :)

When uploading the image the message is:
Quote
File /home/semineem/public_html/images/stories/virtuemart/product/3 uploaded

But if you open a product - example http://www.semineemures.ro/produse/sobe/sobe-lemne/asia-detail - the image is not there.

The filename of the image was "ASIA.jpg".

Please note that we're also receiving random images regarding:
- mimetype (can't reproduce right  now)
- something about a "slug" and some random generated number

How can we fix this?

Thanks!

LATER EDIT: the image is in the stories/virtuemart/product directory (so it did upload). Still, even if the filename is "ASIA.jpg", VM tells in the admin that the Current File is "3." and the "Displayed title" is "3". Also the path is set as "images/stories/virtuemart/product/3". I have no idea where are these numbers coming from... (3?!).

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #1 on: October 05, 2011, 13:40:19 pm »
BUMP...

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #2 on: October 06, 2011, 21:39:57 pm »
The problem with your error is, that it is afaik completly outdated, therefore try first he new version please :-)
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #3 on: October 06, 2011, 21:42:56 pm »
Hi Milbo :)

We're using the latest SVN (svn co https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart): Checked out revision 4287.

When posted the topic, we were still using the latest SVN from that day. Is that fixed in today's version?

Cheers! :)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #4 on: October 06, 2011, 21:51:55 pm »
ahh okey,.. I didnt know that. I dont have any clue. Maybe the image file is affected with a virus?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #5 on: October 06, 2011, 21:56:12 pm »
Nopez... We've tried with the same images we already uploaded...

The access credentials are the same, if you wanna take a look... :)

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3648
  • using Matomo instead of Google Analytics
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #6 on: October 06, 2011, 22:42:30 pm »
When I look at your "Asia" product details page, the image shows correctly and the page contains the image information in the screenshot below. But you don't have a corresponding thumbnail image in the /images/shop/resized/sobe-lemne folder, which is required for the category browse pages.

The "%20" in the url is the result of a space character in your image filename.

The "3" you still might see somewhere as a filename probably is a result from a small bug in a previous version. When you upload an image name that already exists, VM2 adds a random number to the filename in order to create a unique slug. For a very short period one of the VM2 RC versions cut off the filename and just left the random number in place. And since VM2 doesn't overwrite existing filenames, you still might have that one in the database table com_virtuemart_media. Try to use 'replace thumb' or 'create thumb' to solve the missing thumbnail for the category browse page.

If an image doesn't show, but you are shure that the image file is in the correct folder, you can also try to type the exact path/filename into the 'used url/used thumb url' fields under the product image tab and click on 'Save' afterwards.



[attachment cleanup by admin]
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10040
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #7 on: October 06, 2011, 22:44:05 pm »
ahh the flypage problem. My last idea was that you maybe use not everytime lowercase for the template files.

But for the image I dont have an idea. Other images work?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

constantined

  • Beginner
  • *
  • Posts: 13
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #8 on: October 07, 2011, 07:50:43 am »
I suggest to replace
Code: [Select]
while (file_exists(JPATH_ROOT.DS.$path_folder.$media['name'])) {
$media['name'] = $this->file_name = $this->file_name.rand(1,9);
}
with
Code: [Select]
$this->file_name = JFile::stripExt($media['name']).'-';
while (file_exists(JPATH_ROOT.DS.$path_folder.$media['name'])) {
$this->file_name .= rand(1,9);
$media['name'] = $this->file_name.'.'.JFile::getExt($media['name']);
}
$this->file_name = $media['name'];
in /administrator/components/com_virtuemart/helpers/mediahandler.php .
It can solve problem with mimetypes.

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #9 on: October 07, 2011, 10:25:56 am »
I'm noticing that if I upload a new image, it works, but still VM transforms the image into a number. If I'm trying to upload a previously uploaded image, everything goes crazy.

NOTE: should I start over with a fresh installation? We really need to finish this shop, we're two weeks late, and right now we're smashing on various VM bugs/errors. If necessary we can start over...

constantined

  • Beginner
  • *
  • Posts: 13
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #10 on: October 07, 2011, 12:08:27 pm »
Try to cleanup #__virtuemart_medias , #__virtuemart_category_medias and #__virtuemart_product_medias tables and virtuemart  temp image folders.
Don't forget to create backup.

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #11 on: October 07, 2011, 17:17:03 pm »
I found a very simple way to reproduce the bug:

1) create a product, with any name
2) upload a whatever image for that product
3) save the product
----- until here everything is ok
4) create another product, with any name
5) upload THE SAME image as on step 2
6) voila, the error will occur

You can see the error in action on a fresh install - http://www.semineemures.ro/produse/finisaje/finisaje-clasice

I've used the "canaria.jpg" image for both products (Canaria AND Carousel). At the first product (Canaria) the image is right there. If you open the second product (Carousel) you'll see that the image is...not existing! Also in the admin the image is randomly renamed in a number, without any thumbnail (please see attached).

Link: http://semineemures.ro/admin
U: joomla
P: joomla

Note: when making a fresh install I received "Info: Attention dangerous database still active due config setting in file". What's this about?

[attachment cleanup by admin]

constantined

  • Beginner
  • *
  • Posts: 13
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #12 on: October 08, 2011, 08:01:40 am »
Razva, I can only see that you didn't apply hotfix from this post.

Razva

  • Jr. Member
  • **
  • Posts: 55
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #13 on: October 08, 2011, 08:19:08 am »
Razva, I can only see that you didn't apply hotfix from this post.
I just did, and it did the magic! It works right now!

Still, isn't there a way to do this without interfering with Joomla's files?

constantined

  • Beginner
  • *
  • Posts: 13
Re: [BUG] Cannot upload images + mimetype error + slug error
« Reply #14 on: October 08, 2011, 08:30:03 am »
It is virtuemart's, not joomla's file. I hope developers will add this to svn.
(still amazed: why they don't use git?)