1
evren
Error While uploading avatar...Please help me :(
  • 2005/12/17 22:38

  • evren

  • Just popping in

  • Posts: 1

  • Since: 2005/5/17


i got this error while trying to upload an avatar (as admin log on) : Errors Returned While Uploading
Invalid file content

İ set the custom upload option on
İ set the CHMOD to 777 for the uploads directory
İ am sure that the extension and its size are correct

2
erzon
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 10:24

  • erzon

  • Quite a regular

  • Posts: 211

  • Since: 2005/1/1 3


did you look if theres any minimum post count in order to upload custom avatar? check it in your settings

3
Bender
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 16:40

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


On upload the function getimagesize is used to check the file.

There seem to be several possibilities why it could fail judging from the link above.

Is your avator of these filetypes? gif / jpg / jpeg / png / bmp / xbm

Is there any blank within the filename?

Could you upload the (or just one of the failing) avator somewhere so others could test it?


As you can see from the code it should be about the filename since otherwise the error message should be different(imho):

$this->errors = array();
        if ( 
$ext && in_array$ext, array( 'gif''jpg''jpeg''png''bmp''xbm' ) ) ) {
               
// Prevent sending of invalid images that would crash IE
            
if ( ! ( $info getimagesize$this->mediaTmpName ) ) ) {
                
$this->setErrors'Invalid file content' );
                return 
false;
            }
        }
        if (
intval($this->mediaSize) < 0) {
            
$this->setErrors('Invalid File Size');
            return 
false;
        }
        if (
$this->mediaName == '') {
            
$this->setErrors('Filename Is Empty');
            return 
false;
        }
        if (
$this->mediaTmpName == 'none' || !is_uploaded_file($this->mediaTmpName)) {
            
$this->setErrors('No file uploaded');
            return 
false;
        }
        if (
$this->mediaError 0) {
            
$this->setErrors('Error occurred: Error #'.$this->mediaError);
            return 
false;
        }
        return 
true;
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

4
Rigrunner
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 17:56

  • Rigrunner

  • Just popping in

  • Posts: 11

  • Since: 2002/10/12


no blanks in the filename. Ive tried gif, jpg, jpeg and bmp files (not a clue what that xbm one was haha!) all seem to fail but only on the avatar upload. I'm fine with uploads to the Myalbum gallery I have installed so I don't think it's the folder I'm having a problem with (unless I need to set one up just for avatars??) no php problems are showing either, that's why I came here, I couldn't figure out where I was going wrong!

5
m0nty
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 19:28

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


you're using XOOPS 2.0.13.2?

open class/uploader.php

find on line 170:

$this->mediaError = !empty($_FILES[$media_name]['error'][$index]) ? $_FILES[$media_name]['errir'][$index] : 0;


replace with:

$this->mediaError = !empty($_FILES[$media_name]['error'][$index]) ? $_FILES[$media_name]['error'][$index] : 0;


then find on line 181:

$ext substr$this->mediaName$ext );


replace with

$ext strtolower(substr$this->mediaName$ext ));

6
Rigrunner
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 20:07

  • Rigrunner

  • Just popping in

  • Posts: 11

  • Since: 2002/10/12


hey,

yeah ive edited those two things, im still having the problems though.. do i need to refresh the site somehow?

thanks

7
m0nty
Re: Error While uploading avatar...Please help me :(
  • 2005/12/19 20:32

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


nah.. shouldn't need to.

i can't replicate this error.

any chance of a link to your site so we can check it out?

8
jordi_rc
Re: Error While uploading avatar...Please help me :(
  • 2006/9/1 17:31

  • jordi_rc

  • Not too shy to talk

  • Posts: 114

  • Since: 2006/8/21


Hello all!

I am just a beginner in Linux and XOOPS but I have found the solution.

Is related with the file permission of the IMAGE, not the directory. At least, it worked for me.

I was wondering why so many people have this problem.
The fact is that when you save a picture to a cd for example, its access is changed to read only, but in some linux systems it is recorded as if it has no permission, it seems.

I looked at the file permissions (in my Xubuntu linux) and I see that the file had no permissions at all, even to read.

The solution is to change its permissions to read and write for all, graphically thru the GUI (in my case, thunar) or with chmod 777. Remember, we act over the image file of the avatar.

After this, I was able to upload it.

If you don't have control over this like me, maybe you can upload people files to another dir with some module or the image manager, or ask people to send you the avatars, and then chmod them, and upload.

Please test if this works for you all, and if it does, SPREAD this trick so everyone fixes this. This is a common problem I saw all people have in all XOOPS forums, in all languages.

So long,
Jordi
"Battles are fought by those with the courage to believe. They are won by those who find the heart to share." -MANOWAR

Login

Who's Online

461 user(s) are online (415 user(s) are browsing Support Forums)


Members: 0


Guests: 461


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits