404 error on AJAX file upload I get 404 errors on file uploads on a D7.19 website. The displayed error is the usual oversized file but I'm sure it's unrelated (see below).

Here is the apache log message :

POST /file/ajax/field_photos/und/form-YJgDfzca9S88uWmWhrE2GGYBM_sIEKXLGvVKQD34xeU HTTP/1.1" 404 1563 "http://dev.domain.com/node/add/animal" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.26.17 (KHTML, like Gecko) Version/6.0.2 Safari/536.26.17"


I'm sure the server setup is OK because some other sites hosted on it have AJAX working flawlessly.

Disabling Javascript makes file uploads work OK, so it's definitely some Javascript getting in the way somewhere.

What I tried yet : 


changing JQuery version (update or no update)
put the website in english (prod will be in french)
disabling any compression and caching
enabling any compression and caching
disabling some modules (Superfish, dev modules, UI stuff)
different browsers : error is the same everywhere (Safari, Chrome, Firefox).


... and browsed the web like crazy, not finding anything about this precise error.

The only vague hint I have is a file called jquery.cookie whose code doesn't seem to be aliased correctly ((function ($) { // code here })(jQuery); ) but I doubt it could be it.

At this stage, any idea would be welcome. The website is supposed to go live tomorrow (!).
Solved it !

Explanation : 

A file with a name like 'file.xxx' was present at the root of the site. I removed it and everything started to work.

I then put back an empty file named 'file.txt' at the root of the website, and the same error rose again.

It can happen more often than it seems. In my case, I downloaded a patch for the  filefield module which was named file_something.patch and forgot to delete it after applying. Easy to do, easy to forget, hard to remember once you've moved on to something else.

Bottomline : keep your webroot clean of anything not Drupal or you're in for trouble. Can't believe I lost two days with such a simple problem.

Thanks to Mohammed Shameem for his try, and to anyone who gave this a thought.