Connecting Tech Pros Worldwide Forums | Help | Site Map

Saving a remote file

houghi
Guest
 
Posts: n/a
#1: Nov 15 '08
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 maps.google.com
website
2) paste that URL on my site and add "&output=kml" without the quotes to
it.
3) When calling the complete URL (like http://tinyurl.com/5durgg) in a
browser, it will ask to save the file maps.kml

What I want is to have this on my server without it asking to save it
first. So just copy the URL and the have it saved all in one go.

Or must I first save the file maps.kml localy and then save it remotely?

houghi
--
Quote:
> Beware of he who would deny you access to information, <
> for in his heart he dreams himself your master. <
> Commissioner Pravin Lal: "U.N. Declaration of Rights" <

Jerry Stuckle
Guest
 
Posts: n/a
#2: Nov 15 '08

re: Saving a remote file


houghi wrote:
Quote:
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 maps.google.com
website
2) paste that URL on my site and add "&output=kml" without the quotes to
it.
3) When calling the complete URL (like http://tinyurl.com/5durgg) in a
browser, it will ask to save the file maps.kml
>
What I want is to have this on my server without it asking to save it
first. So just copy the URL and the have it saved all in one go.
>
Or must I first save the file maps.kml localy and then save it remotely?
>
houghi
If you're requesting it from your local machine, there's no way to
directly save it on the server because it's not on the server.

To get it at the server, you have to request it from the server. It
shouldn't be that hard to do - just enter the information you want into
a form on your server then request the page using cURL.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
houghi
Guest
 
Posts: n/a
#3: Nov 16 '08

re: Saving a remote file


Jerry Stuckle wrote:
Quote:
If you're requesting it from your local machine, there's no way to
directly save it on the server because it's not on the server.
No, the request comes from http://houghi,org and requests
http://maps.google.com
Quote:
To get it at the server, you have to request it from the server. It
shouldn't be that hard to do - just enter the information you want into
a form on your server then request the page using cURL.
Great. That was what I needed. Thanks. I am now using
http://be2.php.net/manual/en/curl.examples.php#83541 and worked it into
http://houghi.org/tomtom/test02.php (code on
http://houghi.org/tomtom/test02.phps)

I appologize for the hart attacks people will get watching the code. ;-)


houghi
--
Quote:
> Beware of he who would deny you access to information, <
> for in his heart he dreams himself your master. <
> Commissioner Pravin Lal: "U.N. Declaration of Rights" <
Closed Thread


Similar PHP bytes