I recently copied all files to other directory and it seems all files and folder permission changed so I run

    find . -type f -exec chmod 644 {} ;
    find . -type d -exec chmod 755 {} ;

and I still got some issues with file or folder permission 

for example, I got this error when I try upload a product image

> 'Destination folder is not writable or doen't exist'

but the issue solved after I changed this folder and all sub folders permission to 777 /www/media/tmp/catalog

I also got some modules error which works from old one (I solved some after I changed to permission 777) .. so I guess I need to setup files and folder permission correctly 

What folder and files I have to setup as permission 777 to prevent other issue?