There seem to be certain characteristics that a file can posses that prohibits it from being uploaded reliably.
The Photoshop-generated JPEG I'll attach, for example, has about a 50% chance to go through. (After re-saving it from another Image editor, stripping it from most of the meta-data, it goes through fine.)
In the event that it fails, what happens is that Safari claims to be contacting the server, while it actually doesn't transmit any data — or at least not the amount of data necessary for the file upload. (I draw this conclusion from observing the activity lights on my modem/router and the fact that these requests don't leave a trace in the server logs.) Then after a while Safari reports that the server isn't responding.
Created attachment 21596 [details]
Does this happen with all servers for you, or just some particular one?
Well, it turns out this might be a case that is particular to Dreamhost's Rails deployment environment with Apache 2 and Passenger (mod_rails). Nonetheless it occurs only in combination with Safari (possibly on the Mac only).
I've referred Dreamhost's support team to this bug file. This is the ticket for this issue with them, should one of you care to contact them: "[sebwin 18534828] max execution time exceeded". The email is support at dreamhost dot com.
You can test the issue here: http://atcms.driftbit.com/admin/attachments/new
User: test, Password: test
The first four fields expect an image file. The last one a video file. I get this erratic behaviour with files of either kind. The image file I attached earlier fails pretty reliably every other time.
I hope this helps.
I've created a much cleaner test case here: http://driftbit.com/sandbox/upload.html
It is again located on the same Dreamhost machine, but appart from serving the html there is no server intervention (nor client-side scripting for that matter) involved.
Use the attached upload file with Safari on the Mac: the submit action succeeds only every other time.
I know this must be one of the most obscure bugs: upload of certain files from Safari Mac to a Dreamhost server only succeed every other time…
Does that mean this is a known issue?
If so, is it known what triggers this behaviour on the server side or what can be done to avoid it?
I can still reproduce this with Snow Leopard, but not with Lion (10.7.2). Apparently, this was an issue in a closed source network library below WebKit.
Thank you for keeping the test case online for so long! Please verify whether the issue is fully resolved for you.