Jump to content

Problem reading remote file


qteks200

Recommended Posts

2 questions:

 

1) I have a windows server and a linux server. There is a file foo.txt in windows server which is accessible form http, it means you can see the contents of it via browsers with a URL such as : mydomain.com/foo.txt

 

I tried to remotely read this file with php commands such as CURL, file_get_contents, fsockopen and ... . All work fine in localhost (Windows Vista php5 installed) and show me the contents of foo.txt in remote server, but when I run the same script on my linux server (redhat with php5 installed) the response was: 404 not found.

It means windows server have to different behavior for browsing same page. And the prospected behavior is to view the contents of requested file.

how do I solve it?

I have full access to both Windows and Linux server.

 

2) I write down a php Web-Feed aggregator. It reads file from a remote server using CURL. The problem is some sites like feedburner.com after specified count of requests in specified time period, will redirect requested page to another page like feed proxy.feedburner.com/blablabla . How do I handle this redirection?

 

 

Thanks,

r.Sharafi

Link to comment
https://forums.phpfreaks.com/topic/128847-problem-reading-remote-file/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.