Cannot modify header just means the page would have redirected if the error didn't occur. It is a symptom of the other error. I'd have to look a the page and debug this one live. I know you are uploading files to a remote server using a custom script, so I'm not familiar enough with it to try to diagnose the problem out of context.