I am working with a activeX widget that has a method that produces an image which is saved to a users local machine. All the method requires is the path on the local machine. I need to obtain this path (hopefully utilizing a "save as" file dialog) and store its value to a variable so I can pass it to the method. It does work with an input type="file" but they are branded for file uploads an dit is a little misleading and confusing for the user.
var path = $("#saveAsDialog").val(); activeXObj.saveScreenshot(path);
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.
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.
This is code use to save XML file using Javascipt but it can't not save full Processing Instruction, example we have PI is <?xml version="1.0" encoding="utf8"> when run the code then PI is saved with <?xml version="1.0"> and sometime it doesn't word.code...
There is text file save on my pc.i wnat a code which give the solution that after complete the code it should show the that text file and there should be option of download and on click on the download button there should be option of save and cancel and on click on the save there should be option of location so that i could save that file at that location.
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:
I`m using some functions to manipulate contents of local HTML files When modifications are done i would like to make them permanent by clicking SAVE / SAVE AS / EXPORT button How to save dynamically generated HTML elements into the opened file, as well as export them to another one?