VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: rmanuel on February 03, 2012, 08:45:12 AM

Title: Can't upload product pictures
Post by: rmanuel on February 03, 2012, 08:45:12 AM
I've seriously searched this forum and google before posting but I cannot find the answer.

I installed VM2.0 on Joomla 1.7 and everything looks fine. When I go to add a product and then the image, I get the following error when trying to upload it:

store medias Sorry,It's not a valid media file

I made sure the picture is a jpg and under the file size allowed.

I've also played around with other workarounds in the forum and cannot figure this out.
Title: Re: Can't upload product pictures
Post by: Milbo on February 03, 2012, 13:33:40 PM
I looked in the code and there stands

     $lastIndexOfSlash= strrpos($this->file_url,'/');
     $name = substr($this->file_url,$lastIndexOfSlash+1);
     $file_extension = strtolower(JFile::getExt($name));
     if( empty($name) ){
     vmError(JText::_('COM_VIRTUEMART_NO_MEDIA'));
     }


Seems your file does not have an extension ending. There is no dot
Title: Re: Can't upload product pictures
Post by: rmanuel on February 03, 2012, 22:23:40 PM
I checked the file and made sure it is correct. The file has the correct extension and dot. I uploaded the picture via FTP to the product folder and I can bring it up in the media when syncing the files but I can't connect it to the product or upload any pictures using the add product menu. I've even tried changing permissions in the folder.

Is this a common error that I'm receiving?
Title: Re: Can't upload product pictures
Post by: rmanuel on February 04, 2012, 09:39:10 AM
Does anybody have any insight to the problem I'm having. I really like this component and can't wait to use it but I can't figure this out. I have searched forums and google and no one seems to have the exact same problem as me.
Title: Re: Can't upload product pictures
Post by: jenkinhill on February 04, 2012, 13:52:34 PM
You need to confirm that the files are really jpegs and that the filenames are in the format filename.jpg
Title: Re: Can't upload product pictures
Post by: Milbo on February 04, 2012, 14:34:30 PM
Please post your filename here.
Title: Re: Can't upload product pictures
Post by: rmanuel on February 04, 2012, 23:05:15 PM
Here is the file format:

forever.jpg

I've also attached the file.

Any help into this will be greatly appreciated as I am really loving this component.

[attachment cleanup by admin]
Title: Re: Can't upload product pictures
Post by: Milbo on February 05, 2012, 16:26:40 PM
Maybe a wwwrun problem.
Title: Re: Can't upload product pictures
Post by: rmanuel on February 05, 2012, 21:21:26 PM
I figured it out finally. Here was my problem in case anyone else has the same problem!

I forgot to mention that for this particular website, it is being hosted on godaddy. I read through numerous forum posts regarding godaddy hosting and joomla and found a post about a problem that wasn't exactly mine but had similar characteristics. I applied the fix and it worked.

I also wasn't able to upload any extensions through the built in installer or media uploader as well.

I had to go into the hosting control panel, extension manager and change the extensions for php to use without cgi. Once I did that, everything worked perfect.
Title: Re: Can't upload product pictures
Post by: Milbo on February 05, 2012, 21:53:26 PM
without cgi, yes sounds like a wwwrun, phpuser, ect problem. Your cgi user running the php was not allowed to create files. Strange is that the problem is normally the opposite... without cgi the people have with ftp another user than php is using. In this case the hoster must provide a tool so that you can change the file ownership (chmod is not enough, you need chown). Or you run under cgi, which uses for ftp and and the http the same users. But that is godaddy. There are known to have very different setups.
Title: Re: Can't upload product pictures
Post by: donnysobonny on June 18, 2012, 13:22:16 PM
Hi all,

I also had this problem, the resolution to the problem was a bit differen though.

Just incase anyone else gets stuck with this issue, you will find another resolution here:
http://forum.virtuemart.net/index.php?topic=104028.0