You do not have the permissions necessary to view the contents of "folder"

Just add the -R option to recursively change all the permissions of each files and directories under a specified directory. An example, recursively add read and write permissions for the owner and group on foldername:

sudo chmod -R ug+rw foldername

Read more about permissions ...


Instead of giving the whole directory structure insecure permissions that allow any user to write whatever they like to any file in it, make yourself the owner (recursively, using the -R flag):

sudo chown -R $USER: files

There's probably no need for chmod at all, but if you still have problems, check that the owner does have read, write and execute permissions on the directories, and read and write permissions on the files, by using find from the parent directory:

find files -type d ! -perm -u=rwx

If you find something, add an -exec to change the mode:

find files -type d ! -perm -u=rwx -exec chmod u+rwx {} +

Then for the regular files:

find files -type f ! -perm -u=rw

If you find something:

find -type f ! -perm -u=rw -exec chmod u+rw {} +    

This is arguably better than using the -R flag with chmod because we don't want to give files and directories the same permissions.