public static void uploadFile() throws IOException {
		try {
			logDirectory = new File("logs");
    		if ( !logDirectory.isDirectory() ) {
    			logDirectory.mkdir();
    		}
    		date = sdf.parse(sdf.format(new Date())).toString().replaceAll(" ", "").replaceAll("[0-9]+:[0-9]+:[0-9]+CDT", "");
    		
			Properties properties = new Properties(); //creates configuration object
		    properties.load(new FileInputStream(Main.configuration));
		    ftpServer = properties.getProperty("ftpServer");
		    ftpUser   = properties.getProperty("ftpUser");
		    ftpPassword = properties.getProperty("ftpPassword");
		       
	        client = new FTPClient();
	        
	        client.connect(ftpServer);
            int reply = client.getReplyCode();

            if (!FTPReply.isPositiveCompletion(reply)) {
                client.disconnect();
                System.err.println("FTP server refused connection.");
            }
            
	        if (client.login(ftpUser, ftpPassword)) {
	        		client.enterLocalPassiveMode();
	        		String localFile = logDirectory.getAbsolutePath() + "/" + date + ".log";
	        		String remoteFile = "/downloads/logs/" + date + ".log";
	        		if( Main.debug ) {
	        			System.out.println(localFile);
	        			System.out.println(remoteFile);
	        		}
			        FileInputStream fis = new FileInputStream(new File(localFile));
			        if (client.storeFile(remoteFile, fis)) {
			        	System.out.println("File uploaded successfully.");
			        } 
			        else {
			        	System.err.println("Uploading file failed..");
			        }
			        fis.close();
			        client.logout();
			        client.disconnect();
	        } else {
	        	System.out.println("Could not authenticate with FTP server..");
	        	client.logout();
	        }
	        
		} catch (ParseException e) {
			System.err.println("Error parsing log file");
			e.printStackTrace();
		} catch (SocketException e) {
			System.err.println("some exception happened.");
			e.printStackTrace();
		} catch (IOException e) {
			System.err.println("can not open or upload file.");
			e.printStackTrace();
		} finally {
			if (client.isConnected()) {
				client.disconnect();
			}
		}
    }