@param string $base64String

@return UploadedFile
325283
public static function createUploadedFile(string $base64String): UploadedFile
    {
        $file = self::createFileInfo($base64String);

        return new UploadedFile(
            $file->getRealPath(), $file->getFilename(), mime_content_type($file->getRealPath())
        );
    }
600228
public function getUploadedFile(string $key, $default = null)
  {
    return $this->uploadedFiles->has($key) ? $this->uploadedFiles->get($key) : $default;
  }
549518
public function getThumbnailAsBase64String($uri, $defaultAllowed = false)
    {
        $url = self::makeUrl($uri, $defaultAllowed);
        $response = $this->service->makeRequest($url, array(200, 204), 'GET', null, true, 'application/json', 'text/plain');

        return $response['body'];
    }
1162643
public static function encodeBase64($str,
        $lineLength = self::LINELENGTH,
        $lineEnd = self::LINEEND)
    {
        return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
    }
676150
public function base64($sString, $iWidth = null, $iHeight = null)
    {
        $rImg = $this->generateBarcode($sString, $iWidth, $iHeight);

        if ($rImg) {

            ob_start();
            imagepng($rImg);
            $sContents = ob_get_contents();
            ob_end_clean();

            return base64_encode($sContents);

        } else {

            return false;
        }
    }
4215
public function upload(UploadedFile $file)
    {
        self::$generic_file->moveUploadedFile(new File($file,
            $file->getClientOriginalName()), null, $this);

        return $this;
    }
433662
public static function createFromUploadedFile(UploadedFile $file)
    {
        $size = getimagesize($file->getRealPath());

        $image = new Image($file->guessExtension());
        $image->setOriginalFilename($file->getClientOriginalName());
        $image->setMimeType($file->getMimeType());
        $image->setSize(filesize($file->getRealPath()));
        $image->setWidth($size[0]);
        $image->setHeight($size[1]);

        return $image;
    }
1048686
static function makeBase64URI(string $data) {
        $img = \getimagesizefromstring($data);
        if(!$img) {
            throw new \InvalidArgumentException('Bad input data');
        }
        
        return 'data:'.$img['mime'].';base64,'.\base64_encode($data);
    }
1066612
public function uploadFileByFile(UploadedFile $file_request, $fieldName, $classFileString) {
        $file_content = file_get_contents($file_request->getPathname());
        $file_extension = $file_request->getClientOriginalExtension();

        $file_app_object = $this->writeFileBytes($file_content, $file_extension, $fieldName, $classFileString);
        $this->em->persist($file_app_object);
        $this->em->flush();

        return $file_app_object;
    }
649642
public static function urlsafe_b64decode($string) {
		$data = str_replace(array('-','_','@'),array('+','/','='),$string);
		$mod4 = strlen($data) % 4;
		if ($mod4) {
			$data .= substr('====', $mod4);
		}
		return base64_decode($data);
	}
896904
public function base64Encode($webSafe = false)
    {
        $this->val(base64_encode($this->val()));

        if ($webSafe) {
            $this->replace('+', '-')->replace('/', '_');
        }

        return $this;
    }
259053
function toBase64 (media) {
  return new Promise((resolve, reject) => {
    if (isBase64(media)) {
      resolve(media)
    } else if (isURL(media)) {
      urlToBase64(media)
      .then(data => resolve(data))
      .catch(error => reject(error))
    } else if (isFile(media)) {
      fileToBase64(media)
      .then(data => resolve(data))
      .catch(error => reject(error))
    } else if (isBuffer(media)) {
      const base64 = media.toString('base64')
      resolve(base64)
    } else {
      reject('Error: toBase64(): cannot convert media')
    }
  })
}
978646
public function writeBase64 ($content)
    {
        $parts = explode(',', $content);
        if(count($parts) > 1) {
            $base64_encoded = $parts[1];
            $this->writeOver(base64_decode($base64_encoded));
            return self::FILE_CREATE_SUCCESS;
        } else {
            return self::FILE_CREATE_ERROR;
        }

    }
781607
private function isBase64($string) 
    {
        $decoded_data = base64_decode($string, true);
        $encoded_data = base64_encode($decoded_data);
        if ($encoded_data != $string) {
            return false;
        }
        return true;
    }
38034
public function setImageString($imageString, $base64 = false)
    {
        if ($base64) {
            if (false === ($imageString = base64_decode($imageString, true))) {
                throw new FileNotFoundException('IMAGE_E_STRING_INVALID');
            }
        }

        // Create image source resource
        $this->driver->createFromString($imageString);

        return $this;
    }
571447
public function upload($binaryImage, $filename)
    {
        $filename = $this->randomizeFilename($filename);

        if (!$this->constraints->canUpload()) {
            return $this->constraints->getReason();
        }

        $filepath = $this->localDriver->upload($binaryImage, $filename);

        if ($this->isUnsignedUpload) {
            $response = $this->cloudinaryClient->uploadUnsigned($filepath);
        } else {
            $response = $this->cloudinaryClient->upload($filepath);
        }

        return $this->processResponse($response);
    }
965341
public final byte[] decodeString(String base64String) {
        logger.entry();
        byte[] decodedBytes = Base64Utils.decode(base64String);
        logger.exit();
        return decodedBytes;
    }