/    Sign up×
Community /Pin to ProfileBookmark

Download href source instead of open page

We are trying to figure out a way to do this?

We have two IFRAMEs on a page, we want a way to say:

if the user clicks on ANY link/href in IFRAME #2, then go get the source and download it to the server, rename it to an .html file and display that file back in that IFRAME (IFRAME #2).

In other words we don’t want to allow IFRAME #2 clicks/links to open, straight up, we want to download the source, rename and open from that file from our server.

Does anyone know of a graceful way to do this?

Thanks,

2Ps

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooDec 11.2007 — You need to call a proxy script on your server from the links in frame 2.

You can make the call with a javascript GET or Ajax method, but the proxy download and file writing has to be done server side.
Copy linkTweet thisAlerts:
@twopeasauthorDec 11.2007 — You need to call a proxy script on your server from the links in frame 2.

You can make the call with a javascript GET or Ajax method, but the proxy download and file writing has to be done server side.[/QUOTE]


Sounds excellent. Opinion and question...

Which method do you think would be the most sound method to chase for stability and working rock solid now and in the future?

We have never done anything with proxy before, where do you think we could get some help with syntax for this, either forum or link to syntax help source for the method you suggest in the answer to your opinion?

Thanks so much, this is great stuff.

2Ps
Copy linkTweet thisAlerts:
@mrhooDec 11.2007 — The thing to remember when you open a proxy is that it can make it easier to hack your site, so be very careful with the allow permissions when you set it up.

I use php and curl, there are good examples available(google 'php proxy' or 'fcurl proxy'). I'm sure microsoft has equivilent asp or net routines.
×

Success!

Help @twopeas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...