How to access private files without Authentication

For drupal 7, When we create a file field for private access. So we can’t access or download this file without authentication. If sometimes we need this, you can follow my below code: [sourcecode language=”bash”] $uri = [resource_file]; // get file url if ( file_exists($uri) ) { $fileName = end(explode(‘/’, $uri)); $newUrl = ‘public://[your-file-directory]/’ . […]