Upload file with AutoIT.
Use only this: button.upload("C:\\text.txt");

@param filePath e.g. ""C:\\text.txt"
@return true | false
549038
@Override
    public boolean upload(String filePath) {
        WebLocator upload = new WebLocator(this).setTag("input").setType("file");
        return upload(upload, filePath);
    }
249624
public static String verifyReadFile(String filePath){
		if (filePath==null){
			return "The path is null";
		} 

		File dir=new File(filePath);

		return verifyReadFile(dir);			
	}
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}
772846
function(filePath, callback) {
    var text = fs.readFileSync(path.resolve(filePath), 'utf8');
    return this.executeOnText(text, filePath, callback);
  }
973347
public static void writeFile( List<String> lines, String filePath ) throws IOException {
        writeFile(lines, new File(filePath));
    }
309946
public BinaryUploadRequest setFileToUpload(String path) throws FileNotFoundException {
        params.files.clear();
        params.files.add(new UploadFile(path));
        return this;
    }
623097
public static byte[] readFile(String filePath) throws IOException {
        byte[] buffer = new byte[(int) new File(filePath).length()];
        BufferedInputStream f = null;
        try {
            f = new BufferedInputStream(new FileInputStream(filePath));
            f.read(buffer);
        } finally {
            if (f != null) {
                try {
                    f.close();
                } catch (final IOException ignored) {
                }
            }
        }
        return buffer;
    }
391461
public Multipart file(String fieldName, String filePath ){
        formFields.add(new FileField(fieldName, new File(filePath)));
        return this;
    }
1292432
public void addFile(String path, InputStream inputStream) throws IOException {
    addFile(path, inputStream, null);
  }
1120927
public void open(String filePath, final long filePosition) throws FileNotFoundException, IOException {
        open(new File(filePath), filePosition);
    }
600906
@Override
	public boolean delFile(String filePath) {
		try {
			channel.rm(filePath);
		} catch (SftpException e) {
			throw new JschRuntimeException(e);
		}
		return true;
	}
756585
public static boolean createNewFile(String filePath) {
        if (!StringUtils.isEmpty(filePath)) {
            File file = new File(filePath);
            return createNewFile(file);
        }
        return false;
    }
910484
public static String file(String filePath) throws IOException {
        File f = new File(filePath);
        return file(f);
    }
1216097
public static void write2File(String filePath, byte[] byteData) {
        try {
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(new FileOutputStream(new File(filePath)));
            bufferedOutputStream.write(byteData);
            bufferedOutputStream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
774435
public function uploadFile($filepath,$type=2) {
		$send_snoopy = new Snoopy;
		$send_snoopy->referer = "http://mp.weixin.qq.com/cgi-bin/indexpage?t=wxm-upload&lang=zh_CN&type=2&formId=1";
		$t = time().strval(mt_rand(100,999));
		$post = array('formId'=>'');
		$postfile = array('uploadfile'=>$filepath);
		$send_snoopy->rawheaders['Cookie']= $this->cookie;
		$send_snoopy->set_submit_multipart();
		$submit = "http://mp.weixin.qq.com/cgi-bin/uploadmaterial?cgi=uploadmaterial&type=$type&token=".$this->_token."&t=iframe-uploadfile&lang=zh_CN&formId=	file_from_".$t;
		$send_snoopy->submit($submit,$post,$postfile);
		$tmp = $send_snoopy->results;
		$this->log('upload:'.$tmp);
		preg_match("/formId,.*?\'(\d+)\'/",$tmp,$matches);
		if (isset($matches[1])) {
			return $matches[1];
		}
		return false;
	}
1200570
public function isUploadedFile($filePath)
    {
        // If it's a serialized one.
        if (filter_var($filePath, FILTER_VALIDATE_URL)) {
            return true;
        }

        // If it's a normal filename.
        $file = $this->getUploadDir()->getFile($this->getUserDirectoryHash() . '/' . $filePath);
        if ($file->exists()) {
            return true;
        }

        return false;
    }
812919
public static boolean setInitFilePath(String filePath) {
		if (filePath!=null){
			if (init(filePath)){
				return true;
			}
			// try the file name
			String defaultPath=System.getProperty(GlobalFileProperties.class.getName()+".DefaultPath");
			String newPath=defaultPath+File.separator+filePath;
			if (init(newPath)){
				return true;
			}
		}

		String defaultPath=System.getProperty(GlobalFileProperties.class.getName()+".DefaultPath");
		if (init(defaultPath)){
			return true;
		} else {
			log.error(GlobalFileProperties.class.getName()+" No initialized width path:"+filePath+" try to set the path in System propertyes:"+GlobalFileProperties.class.getName()+".DefaultPath");
			return false;
		}
	}