save-as

HTML: how to create a “save as” button?

喜你入骨 提交于 2019-11-30 07:10:49
In your browser, when you want to save an HTML page that you are currently viewing, you normally go to the File menu and click Save As. Can I have a little button at the bottom of an HTML page that does the same thing? So instead of going to the File menu -> Save As, I want my user to be able to click the button to save the page on to the disk. There is a solution exists using Javascript as far as I know, but it only works for IE. See here: link text You could have the link run a server side script that loads the HTML file and writes it back to the client with a Content-Disposition: attachment

Prompting user to save file using a 'Save-as' dialog?

无人久伴 提交于 2019-11-30 04:37:37
问题 I currently have this code: function download(filename, text) { var pom = document.createElement('a'); pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); pom.setAttribute('download', filename); pom.click(); } download('test.html', string); The string contains a lot of html code that gets written in an .html file. The above code is working perfectly: On a button click, the browser (chrome) automatically downloads an html file with the string content written

Using Selenium in Python to save a webpage on Firefox

喜你入骨 提交于 2019-11-29 19:32:14
问题 I am trying to use Selenium in Python to save webpages on MacOS Firefox . So far, I have managed to click COMMAND + S to pop up the SAVE AS window . However, I don't know how to: change the directory of the file, change the name of the file, and click the SAVE AS button. Could someone help? Below is the code I have use to click COMMAND + S : ActionChains(browser).key_down(Keys.COMMAND).send_keys("s").key_up(Keys.COMMAND).perform() Besides, the reason for me to use this method is that I

How to save as a new file and keep working on the original one in Vim?

做~自己de王妃 提交于 2019-11-29 18:35:42
Whenever I use the :sav command, it saves the file with a new name and opens the new file open in Vim. Is it possible to save the file with a new name but keep the original one open for editing? Use the :w command with a filename: :w other_filename Thanks for the answers. Now I know that there are two ways of "SAVE AS" in Vim. Assumed that I'm editing hello.txt. :w world.txt will write hello.txt's content to the file world.txt while keeping hello.txt as the opened buffer in vim. :sav world.txt will first write hello.txt's content to the file world.txt, then close buffer hello.txt, finally open

Save as an Excel file embedded in another Excel file

家住魔仙堡 提交于 2019-11-29 16:21:38
I want to manage with VBA an Excel file embedded in another Excel file. I can find many results with .docx documents, but I stuck with a .xlsx one. My last try is using OLE objects, but stuck at the line "SaveAs" (Error 1004). Here is the weird part: when I start debugging, or if I run the program step by step using F8, it did run, but no file were saved... I called my OLEObject "TEST" for this example: Sub testOLE() mPath = ActiveWorkbook.Path For Each obj In Worksheets(1).OLEObjects If obj.Name = "TEST" Then obj.Verb obj.Object.Activate obj.Object.SaveAs mPath & "TEST_success.xlsx" obj

How can I output a report in PDF format, where the name consists of values from fields?

て烟熏妆下的殇ゞ 提交于 2019-11-29 15:35:42
问题 I want to add functionality to my Access 2007 report whereby a PDF copy of the report is created at the click of a button. I know that there is an OutputTo macro which can do this for me, but it does not allow me to include report field values as part of the PDF's filename, namely: [Client Organisations].Code + "-" + Clients.Code + "-" + Invoices_Code + "-" + Format([Invoice Date],"yyyy") + ".pdf" While I have seen this MSDN thread and this SO question, I don't see the use of field values in

Use Filesaver js with angular2

流过昼夜 提交于 2019-11-29 10:49:11
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? Try the following npm install file-saver --save Then add a declarations file to your project like 'declarations.d.ts' and in it

How to save as a new file and keep working on the original one in Vim?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 13:10:17
问题 Whenever I use the :sav command, it saves the file with a new name and opens the new file open in Vim. Is it possible to save the file with a new name but keep the original one open for editing? 回答1: Use the :w command with a filename: :w other_filename 回答2: Thanks for the answers. Now I know that there are two ways of "SAVE AS" in Vim. Assumed that I'm editing hello.txt. :w world.txt will write hello.txt's content to the file world.txt while keeping hello.txt as the opened buffer in vim.

Why can't I “save as” an Excel file from my Python code?

别来无恙 提交于 2019-11-28 11:26:39
I have an Python ExcelDocument class that provides basic convenience methods for reading/writing/formatting Excel files, and I'm getting a strange error in seemingly simple Python code. I have a save and saveAs method: def save(self): ''' Save the file ''' self.workbook.Save() def saveAs(self, newFileName): ''' Save the file as a new file with a different name ''' self.workbook.SaveAs(newFileName) The save method works perfectly, but when I try to call the saveAs method - myExcelObject.saveAs("C:/test.xlsx") - I get the following error: Traceback (most recent call last): File "C:\workspace

PDF Handler : content-disposition filename

你。 提交于 2019-11-28 07:34:01
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 and if the user chooses to save it then the dialog would give him/her the default filename. I tried also: