/    Sign up×
Community /Pin to ProfileBookmark

Saving a page with a button

Hello,
I have a very simple question.

An HTML page has been populated at the client side.I want a user be able to save all of its contents on the client machine. I know that this action can be done by clicking the IE menu File/Save As. However, I would like my user to click a button on the HTML page to save the contents of the displayed HTML page as a local HTML file.

Is there any possibility to do this?
For information, my pages are generated by a cgi script in tcl.

Moreover it would be wondefull if there were a mean to precise the initial dir to save the page.

Thanks a lot for future answers.

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@LJKJan 26.2006 — Hi -

Might be easier to throw-in a javascript Print This Page button -

then provide alternate css styles for tidy layout results.

Good luck,

El
Copy linkTweet thisAlerts:
@KakooauthorJan 27.2006 — Thanks but i just found an easy solution on another forum.

For information it is putting this in body:

<input name="Save" type="button" value="Save" onClick="javascript:document.execCommand('SaveAs','true','c:myHtmlDirectorymyHtmlSavedPage.htm')">
×

Success!

Help @Kakoo 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.20,
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,
)...