I am frequenty getting “unexpected end of file” errors, I think they only happen on included files and not the base files themselves. But anyway they happen whenever I upload a file at the same time a user happens to load a page that uses the file that’s being uploaded.
How would I go about detecting whether a file is being uploaded? Or is there some way to configure my FTP client (I use FileZilla) to read-lock files while uploading?
You should upload to an temporary directory, and switch the completely-uploaded file with the old file.