1
我读字节的数据,写一个PDF文件到我的tomcat的temp文件夹可以读取从Tomcat Temp文件夹
FileOutputStream fos = new FileOutputStream(File.createTempFile("dummy-file", ".pdf"));
文件被成功写入文件。
在我的应用程序的后期阶段,我需要能够读取该文件。我可以直接从临时文件夹读取任何文件吗?我无法
我正在使用下面的路径在读取时引用该文件。
file:///C:/liferay-developer-studio-1.3.1/Tools/Liferay%20Developer%20Studio/liferay-portal-6.0-ee-sp2/tomcat-6.0.32/temp/dummy-file68824607895269300.pdf //these numbers are string generated randomly while writing the file.
使用此URL我看到空白结果。我认为有另一种方式来读取临时文件夹中的URL?或者是我的网址错了?
什么是存储和检索方法? – 2012-02-02 09:44:26
伪代码,不知何故必须传递生成的文件名。 – 2012-02-02 14:21:24