Can't copy() stream from https site

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Al Reynolds

    Can't copy() stream from https site

    Morning,

    I'm trying to copy a stream from mobical.net to a local
    file (for those of you who don't know, Mobical is a free
    online SyncML server, but they don't officially offer
    iCalendar support). Unofficially, you can go to:

    and enter your Mobical username and password
    (HTTP authentication) . It then begins a download of
    your current calendar etc. as an iCalendar stream.

    I tried:
    --------------------------------------------------------
    <?php
    if (!copy('https://user:pass@www.m obical.net/mobical/ics', 'test.ics'))
    {
    print ("failed to copy file...<br>\n") ;
    }
    ?>
    --------------------------------------------------------
    but I get the following output:
    --------------------------------------------------------
    Warning: copy(): HTTP request failed! HTTP/1.1 401 Unauthorized in
    /var/www/testcopy.php on line 3
    Warning: copy(https://...@www.mobical.net/mobical/ics): failed to open
    stream: Success in /var/www/testcopy.php on line 3
    failed to copy file...
    --------------------------------------------------------

    If I try to copy a static HTML page from an HTTP
    server it works fine, but not with the HTTPS stream.

    Someone here:

    mentions that if they attempt to download the file with
    WGET it redirects once. Could that be part of the
    problem?

    Any ideas what I can try?

    Thanks in advance,
    Al Reynolds


Working...