         uploadComplete = (evt) =>
             @rootScope.$apply ->
                 file.status = "done"
-                data = JSON.parse(evt.target.responseText)
+                try
+                    data = JSON.parse(evt.target.responseText)
+                catch
+                    # NOTE: HACK: In firefox evt.target.responseText is HTML instead json text Why? Why?
+                    data = {}
                 defered.resolve(data)
 
         uploadFailed = (evt) =>

        uploadComplete = (evt) =>
            @rootScope.$apply ->
                file.status = "done"
                data = JSON.parse(evt.target.responseText)
                defered.resolve(data)

        uploadFailed = (evt) =>

        uploadComplete = (evt) =>
            @rootScope.$apply ->
                file.status = "done"
                try
                    data = JSON.parse(evt.target.responseText)
                catch
                    # NOTE: HACK: In firefox evt.target.responseText is HTML instead json text Why? Why?
                    data = {}
                defered.resolve(data)

        uploadFailed = (evt) =>
