473,387 Members | 1,290 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

get remote file content

5
there are some things on server which i can't change:
1. i can't add some extra things like CURL lib;
2. allow_url_fopen is disabled in php.ini, so i can't use nor fopen("remote_file", r), nor get_file_contents(remote_file)....
3. fsockopen can't connect to any server i thing it's disabled by php.ini config too

for example i can do this things in other environments, in asp.net i can do:

#
System.Net.WebClient c = new System.Net.WebClient();
c.BaseAddress = "http://remote-server/";
c.DownloadData("http://remote-server/file.txt");
#

in jsp:

#
URL url = new URL("http://remote-server/");
HttpURLConnection c = (HttpURLConnection)url.openConnection();
c.connect();
InputStream in = c.getInputStream();
String html = stringFromInputStream(in);
#

i can't believe that there is no such similar wayt in php.... but google didn't help me to find any solutions expect fopen, get_file_content or fsockopen....
Jan 8 '08 #1
1 2866
The cURL module lets you do all of that kind of stuff very easily. And fsockopen allows you to connect to other websites. I think that the problem lies with your webhost rather than with php.
Jan 8 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: ebobnar | last post by:
I've written a link aliasing script that allows users to rewrite urls on their web pages. The crux of the script is the following: if(getimagesize($redirect_to) == 0) header("Location:...
4
by: Rene' Nielsen | last post by:
Context: Running Windows 2003 Server on an intranet. A web is configured with an anonymous access account that is a domain account that has been granted the desired access to a file on another...
6
by: Philip Lee | last post by:
Dear all, How can I access files in remote file server through my ASP.NET application only, but deny all other users? I have added <identity impersonate="true" userName="test"...
2
by: Andrea Moro | last post by:
I need to get a remote file via http protocol, get it in some variable and use with some unzipping tool to get the content. So the problem I've is two. First how to read a remote file. I found...
3
by: Vjay77 | last post by:
I posted this question, but I pressed 'post' and it disappeared. So once again: Problem: I need to go to lets say www.site.com/page.html Imagine that this html code is 6 mb long. I need to...
2
by: Adrian | last post by:
Hi I have some local pages (on PC harddisk) that act as a user interface and a set of JS files that controls it all. I now want to be able to access a remote web server to read a txt file and use...
4
by: Ryderch | last post by:
Greetings folks! I need to open a file located on a remote machine running DOS (ouch!) from a client running Vista. The network connection is based on NetBEUI. Test1 Code running on the...
2
by: Martin Zugec | last post by:
Heya, googling\liveing around, but I found no results - any ideas how to retrieve timestamp of remote file (http\ftp)??? Idea is to build auto update utility that could (based on timestamps)...
2
by: houghi | last post by:
I want to save a remote file. The Remote file is created by google maps and has the name maps.klm What I intend to do is the following 1) Make a route, like http://tinyurl.com/5oknap on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.