Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    JavaScript


Save Content From An Iframe To A File?

We use the services of an external company in our website. We load this content in via an iframe. Some of this content happens to be an image.

This image is only stored on the external company's site for a limited time. We need this image to be stored on our servers somehow. Because the content is loaded dynamically from another site it's a little more difficult to access via a server side script
I'm thinking it would go something like:

load in the html for the iframe into a variable,
(no idea how yet, I don't think 'include' works like that)
then scan through the file for the link to the image,
(would be easy with javascript selectors)
then request that url from them and save it as a file somewhere.

I can't think how i can do this easily with php nor ajax... any ideas?
This should work:
maybe something like, use javascript to find the element url, then send a request to another page with a server side script to handle saving the url
...but I'm thinking there might be a better way of doing it.

The people who made the application I'm supposed to be maintaining/extending didn't care for users with no javascript (i know, i know), so because other key functionality doesn't work without javascript (at current...but I'm rebuilding the whole thing at some point but this is a priority feature for asap) i'm not worrying about making sure it works for users without javascript.

View 1 Replies (Posted: Aug 6, 2007, 22:29)

Sponsored Links:

Related Forum Messages For JavaScript category:
Php - Iframe And Save Content?
have working script saving content from editor works in iframe to input hidden, and geting data from post array. But if i want send in framework, not working.I tried to insert a hidden field with formlarza model, using the concatenating and outside the function. unfortunately does not work, but if you send out PHP framework, it works.

window.onload = function()
document.forms[0].onsubmit = function(){


Posted: Sep 12 11 at 17:42

View 1 Replies!   View Related
How To Suppress Save Dialog For PDF File On IFrame
I have an iframe and its src is set to a pdf file. The iframe is hidden and I use it to print a pdf file when a user clicks a button on my html page then pdf file is supposed to print. Everything works fine on chrome, but on firefox and IE it shows a save dialog for the pdf file as soon as the page is loaded. How can I suppress this.

Posted: Dec 4 11 at 9:47

View 1 Replies!   View Related
Iframe - Open, Modify And Save A File With ActiveX?
I tried different methods to open and show a file on client without to send the file to a server.

Opening: I tried to access the file with javascript from a <input type=file>, but the security restriction seems to not allow that. I tried also <iframe src=file://local.path> with the same problem. Last i tried with new ActiveXObject('Scripting.FileSystemObject');, but I get always an error that automationserver could not create the Object.

For saving I tried to use execCommand('SaveAs',true) from TextRange and DocumentFragment. From DocumentFragment I'm able to save a file but it contains only <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">. From TextRange is no save dialog shown.

Posted: Jan 16 11 at 15:57

View 2 Replies!   View Related
Save Textarea Content In File With JS And PHP?
I have a problem with textarea content which I want to save it in a file.So, an user could write in that textarea some HTML,PHP,JS and/or other tags and it wants to save in a fileFirst, I declared a variable in JS which takes the textarea value and send via ajax to PHP.The PHP creates a file and insert textarea content in that file.If I write a simple PHP/HTML/JS code in textarea, the created and saved file doesn't contain anything.It is empty (if I use PHP code in textarea) or sometimes if I write HTML tags in textarea.Look inside my script :So, what's the problem ? The JS is a problem or PHP code ?Code from pastebin:

/* HTML code */
Filename with extension :
<input type="text" placeholder="ex: test.css" id="titlecopypaste" /><br/>


Posted: Aug 6 11 at 14:28

View 1 Replies!   View Related
Save Remote Page That Has Script Content As A File?
I'd like to save a single page automatically. The page uses javascript, and therefore I can't seem to use links, elinks, lynx, w3m or curl (I've tried them with spidermonkey but it keeps telling me to enable javascript) to do so properly, it always saves everything except the javascript rendered output.

So I think the only what to do it would be in a web browser. So, say for intstance, I want to save the the main page, google dot com and have it automatically save to my C:google.htm. How would I do that? Is this possible?

Posted: April 20th, 2010, 10:43 PM

View 1 Replies!   View Related
JQuery :: File Save As Dialog For Dynamic Content
I've a servlet that is invoked via jquery ajax. The resulting XML is then transformed using XSL and displayed on screen. Now, the requirement is to either print or save this content to the local machine. The print portion is working fine but I'm stuck at the Save As part. How do I do this using jquery/javascript? I'm using IE8/XP. I tried:
On button click but it doesn't seem to work in IE8. It shows the alerts I put in till that point, but doesn't bring up the dialog box.

Posted: Jun 1 10 at 22:01

View 1 Replies!   View Related
Increase Iframe Height According To The Iframe Content. Most Content Is Loaded Via Ajax Inside The Iframe?
Major problem : increasing height after ajax content is loaded.

Posted: Aug 11 10 at 6:44

View 1 Replies!   View Related
Ajax :: IFrame Content (JSP File) Height Resizing
Having a problem with iframe resizing when the iframe body is a jsp file which contains a dynamically built ajax table. Users select different options from a drop down. All but 1 is a standard static jsp file. The other is a jsp file with a dynamic ajax table which is generated the second the user select this option from the drop down. Problem is the javascript is not getting the correct height for the dynamically ajaxed jsp file.

Here is the iframe which is loading the contents file.
<iframe id="Editor" name="Editor" src="" scrolling="no" frameborder="0" allowtransparency="true" onLoad="resizeIframeToFitContent(this)"></iframe>
Resize call:
function resizeIframeToFitContent(iframe) {
iframe.height = Editor.document.body.scrollHeight + 300;
iframe.width = Editor.document.body.scrollWidth;
} // resizeIframeToFitContent

As a current workaround I am adding 300 manually to the height this works but throws the height of the normal jsp files well out and makes the page to tall.

Posted: Apr 22nd, 2010

View 1 Replies!   View Related
Save Alternative File On Right-click->save-picture-as
In my site I show low quality pictures. When someone right clicks an
image and selects 'Save Picture As...', I wish to let him save the
high quality picture.

Posted: July 20th, 2005

View 5 Replies!   View Related
Save XML File On My Machine With XMLDom Object Save()?
I'm not able to save to the xml file on my machine.I have noticed that node value is changed temprorily but not permanent in xml file.

P.S : This is only a simple HTML file with javascript .It is giving me an error "Permission Denied"

function viewBookDetails() {
var xmlDoc = xmlLoader("cart.xml");
//var x = xmlDoc.getElementsByTagName("dogHouse")[0];[code]....

is it not possible to save xml file on my machine?

Posted: May 18 11 at 17:00

View 1 Replies!   View Related
Jquery :: Camera In Save Mode Does Not Save File?
When using jquery camera in "save" mode, it seems to have no effect. I tried calling the url in "" manually, it it worked fine. It seems that jquery camera is not working correctly.

<!DOCTYPE html>


Posted: Jun 17 11 at 18:55

View 1 Replies!   View Related
Html - Get Save/Save As File Dialog?
My web site will create a file in client PC in a predefined file path, and I will write to the file. I will display the path in a text box

Example: c:/myfolder/today.txt

Now I have to give a "browse" button on clicking that user should be able to select the target path at his own choice, and then I should use the file name to write the content.

Posted: Sep 21 11 at 10:55

View 2 Replies!   View Related
Create And Modify Xml File (want To Save Xml File On Client Side)?
How to save xml file on client side using javascript...?

if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();


Posted: Nov 25 09 at 9:11

View 4 Replies!   View Related
Possible To Save File Object In LocalStorage / Reload A File Via FileReader
user loads some very large images or media files in to your web app. When they return you want your app to show what they've previously loaded, but can't keep the actual file data in LocalStorage because the data is too large.

Posted: May 28 11 at 0:19

View 2 Replies!   View Related
Possible To Save File As Static Html File With Header Information?
I want to give my widget customers a file to upload to their servers. I dont want it to depend on server side technology (PHP, ASP etc...) so I wont have to maintain variation.The file contains html and javascript (it does redirect based on local cookies).I also need this file to have a special header (P3P privacy policy).how can I create a HTML file which contains header information that customers can upload to their servers?

Posted: Oct 10 11 at 10:52

View 1 Replies!   View Related
Save Innerhtml To Text File Html File On Some Folder
I am using .aspx page, i want to save some data on button click, which i extracted using function to .text file, .html file some folder on desktop.the folder should appear, where i can save the file with any extension of .text or .html.

Posted: Nov 3 11 at 14:00

View 2 Replies!   View Related
Jquery :: Save File From Html File Upload In
I have an html upload <input type="file" id="myfile"/>. When I click it, it is loading the file but cant get whole path like c:documents/images... etc in firefox3.I also have an html button on click I have to save the file to my root folder of application using json when the image is saved, then a popup should open with the browsed image, allowing the user to to crop the image using jcrop. When the user is done cropping, the image should be saved back to my root folder (server side) using jquery and json and using only html controls.

Posted: Aug 25 11 at 3:33

View 1 Replies!   View Related
C - Save Response Type "Content-Type : Text" In Text File?
I am getting some response of HTTP request.Response header is "Content-Type : text/javascript" and some response body.I want to save this response body in text file as "a.txt".Can I do it ? I have "C" files in which I have to do it.

Posted: Sep 9 10 at 7:25

View 1 Replies!   View Related
Jquery :: Trigger Iframe Onload Event When Doing An Ajax Replacement On Content Within The Iframe
I have a view with a credit card payment form hosted on Domain A. Domain B has a seperate website with an iframe to the credit card form on domain A. The form on domain A uses an ajax form like this:

<% using (Ajax.BeginForm("CreditCard", "Framed", new { id = Model.SID },
new AjaxOptions()
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "credit-card-wrapper",
LoadingElementId = "loading-pane"

Then on domain b, I am using a custom jquery plugin to manage my iframe by allowing external events to change the src of the iframe. The usage looks like this


Which causes the iframe to change it's src to the credit card page. I also have attached an onload to the iframe like this:


Posted: Jan 19 11 at 15:01

View 1 Replies!   View Related
Jquery :: Reloading A Tree Navigation Iframe From Container Page And From Content Iframe
What's the best way to reload a tree navigation iframe from within the HTML page containing that tree and from within the content area iframe?

The tree navigation iframe is defined in favorites.php (HTML page) like this.

<iframe id="tnav" src="loadtreeb.php" style="border: 0px; width: 200px; height: 86%; overflow: auto;">

If nodes are added to the tree, there is a button in the HTML page to save the updates by calling savepages.php. That php file is loaded into the content iframe.

<FORM name="pagesform" action="savepages.php" method="post">
<P style="font:12px Arial, Verdana;" >
Add one line for each page in this format: Page Name, Folder Name, <br/>


There must be an issue with getting to the #tnav. What could be the problem? I thought that adding the location window.parent.document to locate #tnav was the right way to reload the tree navigation from within the content area iframe. Whereas omitting the location was the right way to reload from within the HTML page script.

Are there other issues that I had not thought about? Is caching an issue? How do I prevent caching for the tree navigation iframe?

Posted: Jul 27 at 19:50

View 1 Replies!   View Related
Make A Comment Editor With Iframe, And Want To Trigger The Change Of Content Inside Iframe?
I am trying to make a comment editor with iframe, and want to trigger the change of content inside iframe, the following code cant work.code....

Posted: 02-18-2011, 05:06 PM

View 5 Replies!   View Related
Jquery :: Bind Event To Iframe's Content And Trigger It From Iframe
I have isolated very strange bug from our current project:index.html (demo) and iframe.html

1) click at the first input and select any date you will see - "datepicker changed inside iframe!"

2) click at the second input, write some symbols and press at any free space at the page

you will see - "usual_input changed inside iframe!" + "usual_input changed outside iframe!"jquery ui's datepicker trigger change event 100% correctly. why we cant bind to it outside an iframe?

Posted: Mar 10 11 at 21:54

View 2 Replies!   View Related
Jquery :: Resizing IFrame Height From IFrame Content?
weird thing right now. i have an iFrame on one of my sites which grabs it's src from one of my other sites. So both belong to me and I can access both. However sameOriginPolicy is always in the way :) i want to find a solution to autoResize the iFrame depending on it's content. i found a nice autoHeight jQuery plugin that would do that, but unfortunately it can't retriev the body height of the iFrame src because it's on an other domain. i wonder now if theres a solution for that? for instance telling my src file that it's parent (the iFrame) should have a height of e.g. 300px. is that possible?

Posted: Sep 9 10 at 4:52

View 2 Replies!   View Related
Crop The Content Of An IFrame (from The IFrame Container, Without Using Scrolling)
I would like to have a negative inner padding / margin (not to affect scrolling) for an IFrame using some JS / CSS (from outside of the IFrame) is that even possible?

Explanation: the content of the IFrame has a header that I would like to "hide", one option is to control the scrolling, but this will allow users to scroll back and see it, another option is "cropping" the content

Just like positive padding or margin will make any content away from the border, only the other way...

Posted: Mar 30 11 at 5:10

View 1 Replies!   View Related
Copyright 2005-08, All rights reserved