public void fileUpload(File f, String rmPath){
        connected();
        try {
            ChannelSftp sftp;
            Channel channel=session.openChannel("sftp");
            sftp = (ChannelSftp) channel;
            channel.connect();
            if(channel!=null&&f.isFile()){
                sftp.put(new FileInputStream(f), rmPath);
                sftp.chmod(0777, rmPath);
            }
            if(channel!=null && channel.isConnected())
                channel.disconnect();
            if(sftp!=null && sftp.isConnected())
                sftp.disconnect();
        } catch (SftpException e) {
            e.printStackTrace();
        } catch (JSchException e) {
            e.printStackTrace();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        disconnect();
    }