You can try using 755, that works on some servers. Using 777 really shouldn't be a security issue. If someone gets enough access to your machine so that they could take advantage of a folder's permissions, you have already been breached.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.