Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
9 - 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
   

Re: mxdirectory error in uploading logo
by tomodea on 2010/3/11 11:48:19

I discovered another error in mxdirectory image uploading.

The error message "Only png, gif, or jpg !!!" should only appear if you are trying to upload an image which is not a proper image file (png, gif or jpg). We were trying to upload a jpg file so it should be accepted. The mxdirectory module tests for image/gif, image/png or image/jpeg. This is fine under Firefox but not if you are using Internet Explorer.

If you are using Internet Explorer and you try to upload a jpg file then the file is treated as a pjpeg file and we need to test for this file type as well as the other possible file types.

The solution is to update these files:
modlink.php
submit.php
admin/index.php

Look for this statement:
le="color: #000000"><?php if (($_FILES['logoup']['type']=="image/gif") || ($_FILES['logoup']['type']=="image/png") || ($_FILES['logoup']['type']=="image/jpeg")) {


Change it to:
le="color: #000000"><?php if (($_FILES['logoup']['type']=="image/gif") || ($_FILES['logoup']['type']=="image/png") || ($_FILES['logoup']['type']=="image/jpeg") || ($_FILES['logoup']['type']=="image/pjpeg")) {

Re: mxdirectory error in uploading logo
by sailjapan on 2010/3/6 2:20:52

Thanks for sharing!
Re: mxdirectory error in uploading logo
by tomodea on 2010/3/6 2:15:43

I also struck this problem and I'm happy to share my solution.

My analysis shows that there is a logic error in one of the PHP script files.

The PHP script used to submit a new listing is called submit.php. The logic includes a test to check that the maximum file size is not exceeded. The PHP script to handle updates is called modlink.php. This also includes a test to check that the maximum file size is not exceeded. However, it was testing against the maximum image width instead of the maximum file size. Since the maximum image width in my case is set to 300, this will produce an error every time.

Here is the line of code in submit.php:
le="color: #000000"><?php $modlinkform->addElement(new XoopsFormFile(_MD_LOGOUP , 'logoup', $xoopsModuleConfig['logo_maxfilesize']));


Here is the line of code that was in modlink.php:
le="color: #000000"><?php $modlinkform->addElement(new XoopsFormFile(_MD_LOGOUP, 'logoup',$xoopsModuleConfig['logo_maximgwidth']));


The solution is to simply change logo_maximgwidth to logo_maxfilesize.
Re: mxdirectory error in uploading logo
by zeroram on 2009/11/28 7:05:26

wow, he posted the error. got the code working and didnt show the fix... lame
Re: mxdirectory error in uploading logo
by srisree on 2008/9/2 4:55:57

Hello

Can you please share how you solved mxdirectory photo upload problem

regards

Who's Online

543 user(s) are online (501 user(s) are browsing Support Forums)


Members: 0


Guests: 543


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits