C#WebClient上传,PHP保存文件,权限问题

I'm uploading files to my server using C# and WebClient.FileUpload, then using PHP server side to move the temp file to my uploads directory. These uploaded files will include .exe files.

My problem is that the file upload only succeeds when the permissions for the uploads folder are set to 777, even 776 doesn't work. I've read that this probably some server setting preventing this from happening, but isn't this a pretty huge issue? Particularly since I want to allow .exe files to be uploaded, I can't disallow them with a .htaccess.

My only semi-solution so far is to set my uploads dir to 755, then in my PHP script, temporarily chmod it to 777 for the copy, then back to 755. But, I'm sure this is a pretty hackish 'solution'.

Can anyone suggest anything? When I use my credentials with client.NetworkCredentials, why doesn't that work?

I could also zip the executable files with C#, and not allow .exe files.