Page 1 of 1

Remote file accessing using fopen

Posted: Tue Jul 21, 2009 1:04 pm
by varma457
Hi,

I have a problem with reading a secured remote file.I mean for reading a file required username && password..

I tried it this way..

$hange = fopen('http://username:password@www.fragrancen ... 2.txt','rt');

But is showing

failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required

help regarding this problem would be great

Re: Remote file accessing using fopen

Posted: Tue Jul 21, 2009 1:45 pm
by Christopher
You might need to use cURL to deal with the authentication.