       xhr.upload.addEventListener "progress", (ev) ->
         # Progress...
         percentage = ((ev.position / ev.totalSize) * 100.0).toFixed(2) + "%"
-        progressBar.text("Uploading: #{file.name} - " + percentage)
+        progressBar.text("Uploading: #{fileName} - " + percentage)
 
       xhr.onreadystatechange = (ev) ->
         if xhr.readyState is 4
           if xhr.status == 201
-            progressBar.text("Uploading: #{file.name} - Complete")
+            progressBar.text("Uploading: #{fileName} - Complete")
 
-            public_url = $("Location", xhr.responseXML).text()
-            private_url = saveUrl(uuid, public_url)
-            link = "<a href='#{private_url}'>#{file.name}</a>"
+            publicUrl = $("Location", xhr.responseXML).text()
+            privateUrl = saveUrl(uuid, fileName, publicUrl)
+            link = "<a href='#{privateUrl}'>#{fileName}</a>"
 
             progressBar.html(link)
           else

    async: false
    data:
      uuid: uuid
      public_url: public_url
    success: (data, status, xhr) ->
      private_url = data.private_url

saveUrl = (uuid, filename, public_url) ->
  private_url = null

  $.ajax
