Search code examples
phpfilegetfiles

how to get file from a passworded area using PHP


I want to make a script that takes a URL to a file and will import that file to a specific folder in my web server how to request a file if it's in a passworded area, i have an account "username/password" but how can i make the request to that file ?


Solution

  • If it is HTTP Authorization you can access it like that:

    http://username:[email protected]/folder/myfile.jpg