Recently in one of my project I was suppose to download file from a secure website. Actually I have to set the scheduler job for downloading nightly builds/full files from the server and the files are placed on secure website.
Initially I tried that with file_get_contents function but it was just downloading 0KB file. Then it strike me that oh..! I can't use file_get_contents as it can't understand the HTTPS protocol here. So what could help me nothing else then our best friend CURL. file_get_contents and fopen kind of other functions works fine with any http web locations.
Here is the simple CURL file transfer function snippet which will copy file from any secure http location. Read the rest of this entry »