My website contains a iframe which allows the user to navigate the web. If the user clicks a download button on any website I would like it to download in a folder located on the servers itself. So if the user presses download on a image, the image is downloaded onto a folder on the server instead of the computer. Is this possible? I have no idea on how to go about doing this.
You seem to need to display a download button on any website...
You cannot modify all internet websites with your code.
The only way to go this is :
to create a browser extension, like this one : https://chrome.google.com/webstore/detail/image-downloader/cnpniohnfphhjihaiiggeabnkjhpaldj
This extension will be able to interact with any website and do what you want.
or (more simple to code) execute a Javascript of your own that will make floating a download button on any image of any website.
You can do this with this Chrome extension for example : https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija
You can also use a "download" button over the iframe that launch a curl Linux command that will download the iframe page and all the images, files etc...
Related
I'm just experimenting with stuff.
I want to know how I can transfer data from one JS file to another without linking the two files i.e using the script tag on the same HTML file.
So, when I click a button on one HTML file ('file1.html'), it does something to another HTML file (file2.html).
I have used 'localStorage.set/getItem' which did what I wanted. However, when I put my files online, and try open 'file1.html' on the browser of my mobile phone, the 'file2.html' which is open on my pc, does not seem to update when I click the button on my mobile phone.
I'm sure 'localStorage' will not fulfill my require unless anyone can show me otherwise. Is there any way I could still update 'file2.html' which is on pc, with the button click of 'file1.html' which is on my mobile?
*It works when both files are open on pc using localStorage.
Thank you.
I have a landing page on which there is a form which is filled by user and then it goes to a thank you page (which is another page). On thank you page I simply want to prompt the user for saving a pdf as the thank you page loads. Please note I want the file to be saved/downloaded and not opened on the same tab or another tab in the browser. I have tried multiple solutions but they all seem to open the pdf in the browser itself and not download it. Some of the methods I have tried are meta tag download, page redirect download, iframe download but they all open the pdf in browser itself and not download it. I just want a simple solution for downloading the file and not opening it in the browser. Also the pdf should download automatically without clicking any link or button.
The document.ready event of the thank you page should trigger a local script that runs a server script to download the PDF. Be sure to set the headers as described above. If you try to link directly to the PDF, it'll try to load in the browser.
Alternatively, you could create the PDF in a directory that is already set to only download files by setting the .htaccess file for that directory.
I am displaying the number of records using HRef along with Title, all my records are coming from the WordPress connector which are types of PDFs and WebPages. I want to have a my PDF file open in iFrame instead of downloading it. Currently when I am clicking on Href, It is asked me to start downloading.I need this using ASP.NET. I don't have even any control from WordPress connector. It is simple third party.
Simple thing is I want to open a PDF file in iFrame instead of downloading. I want this using JQuery, so when user clicks it will be loaded into the iFrame.
Harshal
I have a code like:
<iframe src="http://www.upnp.org/download/UPNP_understandingUPNP.doc"></iframe>
When this code is rendered, browser file download prompt is shown to user. I'd want to prohibit iframe from showing this download popup.
Is it possible?
I'd want it as iframe's url is controlled by users, not site owner.
No.
The server hosting the URL can decide if it wants to mark it as an attachment (suggesting that the browser to save it) or inline (suggesting that the browser should open it; using a plugin if one is available).
The browser decides how to handle it.
The page linking to it (even if it does so via an iframe) has no control over any of the above.
To avoid the download popup, you could use ajax instead of an iframe to load the url.
I'm developing a custom module for Drupal dealing with Document Management. At this point, the module loads, you can upload files (via a hidden iframe and some ajax requests), browse directories and set various levels of permissions. And everything works perfectly in Firefox.
Issue:
In IE however, I run into an issue. For some reason when I upload a file the save file dialogue pops up and asks me to download the file I just uploaded. It looks like it's asking me to download it from the web-servers tmp location however, as that seems to be the file-name and such. However, if I hit cancel and refresh the page I can see that the file I uploaded did actually get uploaded to the server.
Here is how the upload process works. Click the upload button. The upload button is the standard file input form element hidden and placed over a styled version of the button. Clicking on this causes the "Choose a file" dialogue to open.
Select a file and click "Open". A modal dialogue pops up asking you for some further information about the file. The modal is part of the same form element but remains invisible until you click Upload button
Clicking save in the modal causes the file to be uploaded. The "action" attribute on the form is pointed to a page and the target is the iframe.
The iFrame is polled a few times every second to see if it's contents have changed. When the file is uploaded a "success" message appears in the iframe. Since it belongs to the same domain, I scrape the content within the iframe.
Once the iFrame says that the file has been uploaded, I use some JS to update the application with the name of the file
Since I can't use Firebug in IE, I have to stick to utilizing Microsofts Web Developer Toolbar, which makes it very hard to figure out if the bolded step is actually occuring. It seems like it should, since the file IS being uploaded. It is just getting interrupted by that file download dialogue.
Since no one seems to have an answer, I'll post the fix I found. I doubt it's perfect, but it's the best solution I could come up with.
It turned out to be an issue with the polling as suspected. The fix ended up being instead of outputting json to the iFrame, just output some JavaScript that calls a function that updates the main window. That simple.