for wordpress you have to place it in the / (root) of the account (usually this is the /public_html/ directory) and in the /wp-admin/ directory
for joomla you have to place it in the / (root) of the account (usually this is the /public_html/ directory) and in the /administrator/ directory
Note you usually have to set two parameters i.e. :
; Maximum allowed size for uploaded files.Some applications also need you to set this in their configuration like Wordpress Multisite as they override the php settings.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M