Recently, we have had some sites which began to exhibit file upload failures when they had been fine previously. The standard culprits were eliminated quickly (paths, permissions etc). After looking long and hard for a solution I found it in a most unlikely place and thought I would share in effort to help others who may experience the same. This solution is most likely to be of interest to users whose sites are hosted on shared servers but can affect anyone.
If you have already checked permissions and are certain that your paths are correct (more information can easily be found elsewhere in the forums) you may be running into a problem with the temp folder where files are initially uploaded to before being moved to their appropriate location. It is possible that the temp folder is full and the server cannot write it to disk. This problem can cause the progress bar in the resource browser to fill partially before popping up the dreaded file upload error.
One way to check this is to upload a dummy form which posts to itself and outputs the information about the file upload. If you upload a file and get an error value of 7 or UPLOAD_ERR_CANT_WRITE you are experiencing this problem. You’ll also notice that the $_FILES array in PHP does not contain values for tmp_name, size or type. If you are not a PHP developer and want to test this I would be happy to send you a dummy form to test this with.
To fix, most of you will have to contact the host and have them purge the temp folder as you won’t be able to do it yourself. You could also try changing the upload tmp folder but you need to use a custom php.ini to do that and that may not be possible on some hosts. If you have your own server, then just purge the tmp folder and consider having a different tmp folder to prevent this if it occurs frequently.
The particular site I experienced this with is a cloud site hosted in the rackspace cloud (formerly mosso) and you need to create a ticket to resolve this. Support may tell you to change the tmp folder but for some reason, the directive to do so is ignored in custom php.ini files there.
This is just one more thing to watch out for and does not have much or nothing to do with ModX itself although it might seem so at first.