我想使用网络应用程序将文件上传到投递箱。但问题是Java正在询问完整的文件路径。我需要做什么?这是我的代码:如何上传文件到Dropbox?
File inputFile = new File("D://New Text Document.txt");
System.out.println("inputFile.getAbsoluteFile(): " + inputFile);
FileInputStream inputStream = new FileInputStream("D://New Text Document.txt");
try {
DbxEntry.File uploadedFile = client.uploadFile("/magnum-opus.txt",
DbxWriteMode.add(), inputFile.length(), inputStream);
System.out.println("Uploaded: " + uploadedFile.toString());
} finally {
inputStream.close();
}
第一行是要求文件路径;这怎么可能?
如果我给相对路径显示错误,如文件未找到异常。 – kamesh 2014-12-03 14:35:41