开发者

Java: Write to tempFile in Windows Temp Directory

开发者 https://www.devze.com 2023-02-18 23:29 出处:网络
I am trying to learn Java in few day. I trying to write content to temp file and save this file in temp folder in Windows (that\'s my task).

I am trying to learn Java in few day. I trying to write content to temp file and save this file in temp folder in Windows (that's my task). I find some solution, but not w开发者_开发知识库ork for me :(

http://www.mkyong.com/java/how-to-write-data-to-temporary-file-in-java/

http://www.roseindia.net/java/example/java/io/create-temp-file.shtml

Some time, i get error on applet, another way is empty page and file is not created, anywhere.


You mention an applet, these operate in a sandbox and will not have access to the local file system. That is why it is not working for you.

Here is another rose india link re writing to a file from an applet.


To extend Paul answer.

Using applets you will have to ask user for location, where the file can be stored.

This behavior prevent applet free access to used hard disk.

0

精彩评论

暂无评论...
验证码 换一张
取 消