News:

Support the VirtueMart project and become a member

Main Menu

Can't upload product pictures

Started by rmanuel, February 03, 2012, 08:45:12 AM

Previous topic - Next topic

rmanuel

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.

Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rmanuel

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?

rmanuel

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.

jenkinhill

You need to confirm that the files are really jpegs and that the filenames are in the format filename.jpg
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rmanuel

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]

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

rmanuel

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.

Milbo

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

donnysobonny

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