title: dropzone.js: How can I rename file?
body: <p>I want to rename a file uploaded with dropzone.js. I have read the other question of rename file with dropzone, but I don't understand.</p>
  
  <p>I've tried this:</p>
  
  <pre><code>this.on("sending", function(file, xhr, formData) { 
      var abdocument.getElementById("a").value
      var nick = document.getElementById("b").value;
      formData.append("fileName", a+ " - " + b);
      });
    }
  };
  </code></pre>
  
  <p>but then how can I use this "fileName"? I've to use in php function? This is mine:</p>
  
  <pre><code>&lt;?php
  
  $upload_folder = 'uploads';
  if (!empty($_FILES)) {
    $temp_file = $_FILES['file']['tmp_name'];
    $target_path = dirname( __FILE__ ) .  '/' . $upload_folder . '/';
    $target_file =  $target_path . $_FILES['file']['name'];
  
  
    if( file_exists( $target_path ) ) {
      move_uploaded_file($temp_file, $target_file);
    } else {
      header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
    }
  }
  
  ?&gt;
  </code></pre>
  
  <p>or can I rename via javascript?</p>
  
  <p>Thanks to all</p>