Show Save As Dialog Box After Clicking Link / Button
Mar 9, 2010
I am using ASP.net and javascript. Presently I have a link on the web page, which opens an image....if the user wants to save it , he has to right click the image and then save it. But,I don't want the user to right-click and choose the option "Save Picture As" or "Save Image" of the browser. Instead I want the user to click a link or button that is displayed just under the image. After clicking the link/button, the user should be able to save the image in his/her local hard disk/machine in a particular folder or just under C: or bringing up the file directory dialog box where the user can save in his/her own folder.
What I'm trying to do is have a 'Save As' dialog box pop up when I click an anchor tag. What's hidden in the anchor tag is base64 information, so my anchors look like this: <a href=# src='data:image;base64, (base64 string here)' ></a> So when I click on this, it gives me the option of downloading my base64 info just fine, but the problem is, the name of it looks to be just the entire base64 string. I was wondering if there was a way I could set this name? I can get the file name, so I'd love to just put '....jpg' as the name that the user downloads.
The reason I'm asking is because when I download the file, it comes out as (random characters).bin.part, and if I know the download is a pdf, I try opening it with a pdf viewer, but get yelled at by the MIME type... however, if I simply change '.bin.part' to '.pdf', I can open the file just fine, so I'd love for an automatic naming system, but not sure how to implement that. I've tried the document.execCommand('saveAs', '1', '<filename here>'), but I think this is for an actual file that you serve from the server... I don't have the actual file, just the base64.
I want to be able to do is to have a button that when the user clicks on it, it will open a "save as" dialog box so they can save a file (a separate file, not the html one that they are looking at) from my server. Is this really not possible using javascript, or am I just completely confused again?
I have a gridview in a form that contains a Save ImageButton. I would like to create a Client-side CustomValidator that checks whether the grid is empty or not. If it is empty then I would like to throw an error message to the user. This is my code. In the "Save_btn_Click" event, I check if the page is Valid:
Can I make a list of hyperlinks that users can customize and save as a cookie by clicking a button and automatically retrieve the cookie so it remembers their list next time? This is kind of what I want to do:
I need an way to upload a file by clicking a link instead of button(<input type="file" name="somename"/>). This feature has been newly added to GMail, to attached a file we need to click a link.
I have the following website: [URL]. As you can see, there are a couple of news items. In fact, there should be 3 items on the homepage, the rest should be hidden.
When you click the button "oudere nieuwsberichten" what means "older news", the other newsitems should be shown underneath the 3 existing ones.
what i'm trying to do is have it when once a user clicks on a banner the join raffle button will show after clicking on the banner, along with opening up a new window to the link the banner had. I've been trying to set up a onclick event to do this but haven't had success This is the code ive tried using.
When you right click on a link you get the option to save target as...(ie) and save link as...(netscape). Is there some JavaScript to call this function like the JavaScript to open a new window?
There's an outgoing link on my website that is sometimes slow to respond. I want to show a spinning wheel image after clicking it. Here is how I do it:
There are 2 problems: Firefox doesn't remove the "loading" class when going to another page and clicking the browser's Back button. Google Chromedoesn't add the class "loading". Instead itimmediately opens the pagetargetedby the link.I solved this by adding a "delay()". Is this the best approach?
I have a confirmation page, we would like to have a SAVE button option for our customer to save the page, is it possible to SAVE only the message or page, not for the entire site?
if you have done it before, can you please help...thanks so much in advance. Or please give some suggestions how can we save the confirmaiton message page
The trouble is, is that some pages are very long and some are very short, so using offsetTop is obviously not bringing the form into full view ;-( Still keeping all the functions detailed in the code below, how would you adjust the code to achieve the aim of always showing the form, when clicking on the button to show the form, regardless of how long or short the page is please?
What I'm trying to do is have a 'Save As' dialog box pop up when I click an anchor tag.What's hidden in the anchor tag is base64 information, so my anchors look like this:
So when I click on this, it gives me the option of downloading my base64 info just fine, but the problem is, the name of it looks to be just the entire base64 string. I was wondering if there was a way I could set this name? I can get the file name, so I'd love to just put 'blah.jpg' as the name that the user downloads.The reason I'm asking is because when I download the file, it comes out as (random characters).bin.part, and if I know the download is a pdf, I try opening it with a pdf viewer, but get yelled at by the MIME type... however, if I simply change '.bin.part' to '.pdf', I can open the file just fine, so I'd love for an automatic naming system, but not sure how to implement that.I've tried the document.execCommand('saveAs', '1', '<filename here>'), but I think this is for an actual file that you serve from the server... I don't have the actual file, just the base64.
i have been working with jquery dialog for a while and am stuck on a new problem today.when i load a dialog, it is running the button functions when the dialog is opened.
I am distributing some files on CD. Among other files i have
download.htm and DataFile.txt
When download.htm file executes, it shoud set the path to the download file as the path for my data file and then opens the save as dialog box when user can then select storage location.
I am trying to develop an exam system.Find my code below.I request you to copy the code and save it as an html file .I have 2 problems:
1. Kindly notice that when the quiz is loaded,it shows both the questions by default.I want only question 1 to be visible when the quiz loads.What happens presently is that ,both questions are visible even after I click on the link Q.1( referring to question 1).However,when I click on Q. 2,then only question 2 can be seen and then(after clicking on Q.2) if I click on Q.1,then only question 1 can be seen
What I want is that when the page loads only question 1 is visible.Then when I click on Q.2,I can see only question 2 and when I click on Q.1, I can see only question 1.I later plan on adding many questions,so it should be a general solution rather than a solution good only for 2 questions.
2.Also,what I want is that,if someone selects any of the answers of a particular question,it's link color should turn green to indicate to the user that he answered that question.So for,instance,if I select an answer to the first question(select one of London,New York,Seattle,Washington,Chicago), the link Q.1 should turn green.