Allow upload/download but limit login users from selected IP's
I'm looking for solution to limit ownCloud access to login page from selected IP's only but allow shared links for download/upload from anywhere. Please is there some solution or workaround to do this? I successful tried to limit access to login from selected IP's and allow public.php from all, but upload function to public shared directory is not working anymore after my change in .htaccess example bellow. Thank you very much for your advise.
<IfModule env_module> SetEnv htaccessWorking true
SetEnvIfNoCase Request_URI "public\.php" ALLOWED_PHP
ErrorDocument 403 "Forbidden"
allow from 2xx.81.1xx.83/32
allow from 7x.1xx.0.x/13
allow from env=ALLOWED_PHP