title: move file uploaded from nanohttpd's Temporary directory to SD card
body: <p>I am uploading a file "LICENSE.txt" from my PC to Android WebServerApp.
  NanoHTTPD uses a temporary directory to save the uploaded files. The temporary location is decided by :</p>
  
  <pre><code>    tmpdir = System.getProperty("java.io.tmpdir");
  </code></pre>
  
  <p>and file gets uploaded as : <strong>/data/data/com.manmohan.mynanoserver/cache/NanoHTTPD-1736025823</strong> in my case.</p>
  
  <p>After the upload I want to move the file to my SD card "/storage/extSdCard/Uploads".</p>
  
  <p>Here's what I do :</p>
  
  <pre><code>        String tempFileName = entry.getValue().toString();
          File fileToMove = new File(tempFileName); // temp file path returned by NanoHTTPD
  
          String p = "/storage/extSdCard/Uploads";
          String newFile = p + "/LICENSE.txt";
          File nf = new File(newFile); // I want to move file here
  
          if (fileToMove.canWrite()) {
              boolean success = fileToMove.renameTo(nf);
              if (success == true) {
                  // LOG to console
                  Log.i("FILE_MOVED_TO", newFile);
              } else {
                  Log.e("FILE_MOVE_ERROR", tempFileName);
              }
          } else {
              Log.e("PERMISSION_ERROR_TEMP_FILE", tempFileName);
          }
  </code></pre>
  
  <p>I cannot access the <strong>/data/. . .</strong> directory and files in it, and get error when try to move file.</p>
  
  <p>But this temporary path works :</p>
  
  <pre><code>    tmpdir = "/storage/extSdCard/temp-uploads-nanohttpd";
  </code></pre>
  
  <p>What's wrong with <strong>java.io.tmpdir</strong> ? If NanoHTTPD can write to it, then why I am not able to move the file ?</p>