save-as

Use Filesaver js with angular2

冷暖自知 提交于 2019-11-28 03:54:51
问题 i have checked all the post i can find on the use of Filesaver JS with angular, but i still could not wrap my head around a soution. I added this to the map section of my system.config.js 'filesaver': 'node_modules/filesaver/src/Filesaver.js' I added this to the packages section of the system.config.js 'filesaver': {defaultExtension: 'js'} I then imported it in my service.ts this way import { saveAs } from 'filesaver'; Yet i get this error. Can someone help please? 回答1: Try the following npm

How to export a FusionChart to Image in ASP.Net

元气小坏坏 提交于 2019-11-28 02:26:09
问题 We are using the free version of fusion charts and want to know is there a way to export the generated chart to image without using any third party components. We are using the ASP.Net for generating the charts. 回答1: SOLUTION After a research on this topic, I have found a useful solution for this. For that we need to have a freeware from Bytecout to convert swf to image. This can be downloaded from this link. Then we need to register the COM dlls and add the reference to our project. Refer to

Trigger a Browser's Save-As Dialog via Javascript using only On-page data

十年热恋 提交于 2019-11-27 09:07:10
As part of my page's output, I'm including a CSV formatted version of a data table in a text area, so that the user can easily copy/paste a CSV export into their spreadsheet of choice. I would like a way to have a button that, when clicked, will trigger a Save-as dialog that will download the CSV contents already present in the textarea on the page. The intention is to avoid another trip to the database to get the CSV export, when it is already on the page, while providing the user a shortcut around having to create a new file and paste in the copied CSV. Is this possible? robertc I don't

Cross-browser Save As .txt

别来无恙 提交于 2019-11-27 05:21:21
Is there a JavaScript library that allows to save strings as txt files, and works cross-browser? In the past, I have been using Downloadify, but I am looking at another option for a couple reasons: I hope to find a pure JavaScript solution, without the need for Flash it seems that Downloadify is not updated anymore (no update in the past 18 months) I am experiencing an issue with Downloadify in IE 9, where strings are cut off As far as I know, the only way is to use data: URLs to force a download: var data = "This is a test"; window.location.href = "data:application/x-download;charset=utf-8,"

PDF Handler : content-disposition filename

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 01:58:04
问题 I am outputting a PDF file in a Web browser (IE8) HttpContext.Response.writefile(fileName) and it works great. When I try to save the file, it will give me the name of the ashx handler as a default. I would like to actually pass the real name. I tried to add header information as follow: context.Response.AddHeader("content-disposition", "attachment; filename=" + fileInfo.Name); And it works but I do not want the user to have to choose between open and save, i want the file to open normally

Trigger a Browser's Save-As Dialog via Javascript using only On-page data

对着背影说爱祢 提交于 2019-11-26 14:33:57
问题 As part of my page's output, I'm including a CSV formatted version of a data table in a text area, so that the user can easily copy/paste a CSV export into their spreadsheet of choice. I would like a way to have a button that, when clicked, will trigger a Save-as dialog that will download the CSV contents already present in the textarea on the page. The intention is to avoid another trip to the database to get the CSV export, when it is already on the page, while providing the user a shortcut

Cross-browser Save As .txt

假装没事ソ 提交于 2019-11-26 11:31:51
问题 Is there a JavaScript library that allows to save strings as txt files, and works cross-browser? In the past, I have been using Downloadify, but I am looking at another option for a couple reasons: I hope to find a pure JavaScript solution, without the need for Flash it seems that Downloadify is not updated anymore (no update in the past 18 months) I am experiencing an issue with Downloadify in IE 9, where strings are cut off 回答1: As far as I know, the only way is to use data: URLs to force a

Is there any way to specify a suggested filename when using data: URI?

淺唱寂寞╮ 提交于 2019-11-26 05:40:14
问题 If for example you follow the link: data:application/octet-stream;base64,SGVsbG8= The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself. Is there any way of suggesting a default name in the markup? If not, is there a JavaScript solution? 回答1: Use the download attribute: <a download='FileName' href='your_url'> Live example on html5-demos.appspot.com/.... Currently works on Chrome, Firefox, Edge, Opera, and desktop Safari but not iOS Safari