title: Jquery File upload Blue Imp - setting dynamic upload url
body: <p>I am using Jquery upload file library and am having difficulty setting the directory to write the files to.  If I use the standard location as set in the examples the files are uploaded. 
  The following code works: </p>
  
  <pre><code> $('#fileupload').fileupload({
              disableImageResize: false,
              autoUpload: false,
              // Uncomment the following to send cross-domain cookies:
              //xhrFields: {withCredentials: true}, 
               //url: currentDir
              url: '/assets/plugins/jquery-file-upload/server/php/'
          });
  </code></pre>
  
  <p>But If I try to change the url as follows: </p>
  
  <pre><code>    var currentDir = window.location.pathname;
  
  return {
      //main function to initiate the module
      init: function () {
  
           // Initialize the jQuery File Upload widget:
          $('#fileupload').fileupload({
              disableImageResize: false,
              autoUpload: false,
              // Uncomment the following to send cross-domain cookies:
              //xhrFields: {withCredentials: true}, 
               url: currentDir
              //url: '/assets/plugins/jquery-file-upload/server/php/'
          });
  </code></pre>
  
  <p>I receive this error:   SyntaxError: Unexpected token &lt;</p>
  
  <p>I've also looked at implementing this solution:  <a href="http://www.eliwheaton.com/web-development/dynamically-set-upload-directory-using-blueimp-jquery-file-upload" rel="nofollow">http://www.eliwheaton.com/web-development/dynamically-set-upload-directory-using-blueimp-jquery-file-upload</a></p>
  
  <p>But no joy.  Any ideas?</p>
  
  <p>Thanks</p>