Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You could either make <code>/</code> writable by your app server (which doesn't seem like a great idea to me) or store your uploaded files in another writable location.</p> <pre><code>File uploadedFile = new File(UPLOAD_DIRECTORY + fileName); File uploadedFile = new File("/"+fileName); </code></pre> <p>You also appear to be trying to declare <code>uploadedFile</code> twice. From the error, it looks like either <code>UPLOAD_DIRECTORY</code> is <code>/</code> or you're actually using the second line. Perhaps you just need to supply the right location in <code>UPLOAD_DIRECTORY</code>?</p> <p>To answer your comment-question about Java policy files:</p> <p>From <a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html#over" rel="nofollow">Security and Permissions</a> on java.sun.com:</p> <blockquote> <p>There is one policy file for Java platform installation (system) and an optional policy file for each user. The system policy file is in {java.home}/lib/security/java.policy, and the user policy file is in each user's home directory. The system and user policy files are combined. So for example,there could be a system policy file with very few permissions granted to all users on the system, and individual policy files granting additional permissions to certain users.</p> </blockquote> <p>See the <a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html#FilePermission" rel="nofollow">File Permission</a> section for setting file system permissions in the policy file.</p> <p>And to reiterate my own comment, you'll also want to pay attention to file system permissions in the OS, control of which will depend on the OS you're using.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload