We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5568
    • 35 Posts
    Quote from: Dimmy at Sep 18, 2007, 08:17 AM

    maybe adding a date or time to the filename would work?

    first delete de existing photo and then move the uploaded picture from temp to userimages folder with a unique name. that way it is soved I think.

    I also tryed deleting the first one but now it wil not upload a new one and I see no image (I see the broken-image-image).

    and I am not able to upload a new image at all using the edit profile option. I do not get an error but there is no image uploaded (yes I looked in userimages folder)

    Dimmy

    if you want SD i can give you the url so that you can test this.... I pmed you the info

    Hey Dimmy,

    1st off: right-click your broken-image to see the url of the image that is being called?

    Next:
    I am guessing you are using the instant registration option?  Not sure about how that option loads a image on first call, but I do know about the saveprofile option, which is after the registration is completed.

    I had to make a change to where the uploaded file folder to make my work:

    Changed coding, the orginal coding is long gone from my class.php file:
    	function CreateUserImage()
    	{
    		global $modx;
    		
    		$imageAttributes = str_replace(', ', ',', $this->UserImageSettings);
    		$imageAttributes = explode(',', $imageAttributes);
    		
    		if ($_FILES['photo']['size'] >= $imageAttributes[0])
    		{
    			$sizeInKb = round($imageAttributes[0] / 1024);
    			$sizeError = str_replace('[+000+]', $sizeInKb, $this->LanguageArray[28]);
    			return $this->FormatMessage($sizeError);
    		}
    		// Only change I made is here:
    		$userImage = $modx->config['base_path'].'assets/snippets/webloginpe/userimages/'.strtolower(str_replace(' ', '-', basename( 
    
    $_FILES['photo']['name'])));
    


    This may fix the new uploaded image file, but again I also have to refresh my browser to see the new image since it probably has the same imageFileName.

    Good Luck,
    Mark
      • 26435
      • 1,193 Posts
      Oh! Good point Mark!
      I forgot that we solved that issue earlier. I need to make a special note of that.

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages