@Override
	public boolean uploadImage(BufferedImage image, String filename, String fileType)
	{
		if (mClient == null && !connect())
		{
			return false;
		}

		if (mClient != null)
		{
			try
			{
				if (!ImageIO.write(image, fileType, new File(filename)))
				{
					System.err.println("Could not save the image to disk. FTP upload therefore also failed. Image name: " + filename);
					return false;
				}

				FileInputStream fis = null;
				try
				{
					fis = new FileInputStream(filename);
				}
				catch (FileNotFoundException e)
				{
					System.err.println("Could not open the image to read for FTP transfer. Image name: " + filename);
				}

				if (fis != null)
				{
					try
					{
						mFilename = filename;
						return mClient.storeFile(filename, fis);
					}
					catch (IOException e)
					{
						System.err.println("Error in uploading the file to the FTP server. "+connectionInformation());
					}

					try
					{
						fis.close();
					}
					catch (IOException e)
					{
						System.err.println("Could not close the image file. Image name: " + filename);
					}
				}
			}
			catch (IOException e1)
			{
				System.err.println("Could not save the image to disk. FTP upload therefore also failed. Image name: " + filename);
			}
		}

		return false;
	}