从javascript中的文件路径获取文件

从javascript中的文件路径获取文件,javascript,forms,http-post,file-handling,Javascript,Forms,Http Post,File Handling,我想使用http.post请求使用javascript将我的表单(其中包含文件和名称)发送到服务器,但我无法获取javascript中的文件。我将如何做,我有文件路径。我不想用输入标签来做这件事 var Form = new FormData(); Form.append("file", file);//this file has to added using path of the file $http.post(url, Form, { transformRequest: angu

我想使用http.post请求使用javascript将我的表单(其中包含文件和名称)发送到服务器,但我无法获取javascript中的文件。我将如何做,我有文件路径。我不想用输入标签来做这件事

var Form = new FormData();
Form.append("file", file);//this file has to added using path of the file

$http.post(url, Form, {
    transformRequest: angular.identity,
    headers: { 'Content-Type': undefined }
})   
.success(function(d) {
    console.log("sucess" + d);
});

可能重复我正在使用angularjs处理illustrator的扩展名。我想将文件发送到我当前正在处理illustrator的服务器。我能够获取文件的路径,但如何获取文件。?