savefiledialog

Displaying Save File Dialog in Asp.net web page

孤街浪徒 提交于 2019-12-02 10:33:03
问题 I have a ASP.net page which writes a file to the local disk. I want to present the user a Save File dialog box and allow him to set the path to the folder. I know code like below can be used; Response.Clear(); Response.ContentType = "text/csv"; Response.AddHeader( "Content-Disposition", "attachment;filename=\"report.csv\"" ); // write your CSV data to Response.OutputStream here Response.End(); But it fixes filepath. I need to capture the filepath that the user selects. Is that possible in ASP

Any known problems with getting SaveFileDialog's InitialDirectory property working in Windows 7?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 07:39:12
I'm working in C# and can get the SaveFileDialog to reset to the InitialDirectory in Windows XP, but the same code does not work in Windows 7. Every time the dialog comes up in Windows 7, it opens to the last directory saved to or opened from instead of the directory I am setting as the initial directory. I have tried changing the RestoreDirectory setting and setting AutoUpgradeEnabled to false, but neither have worked. I cannot provide a code sample, but I can give you an idea of what's happening: Every time the user tries to save a file that is in use by someone else, they are given the

Save filedialog not working

ぐ巨炮叔叔 提交于 2019-12-02 05:01:22
Bit of an odd one here , I'm writing an app which gives a save file option , the save file dialog is coded up as normal SaveFileDialog ofd = new SaveFileDialog(); the dialog box comes up no problem and clicking save doesn't throw up any errors however no file is saved and I'm not sure why , any ideas ? I've googled it and can't find a similar problem The SaveFileDialog class doesn't save anything, it prompts the user to choose a location and a file name to save the file. It is your job to save the file This example extracted from the MSDN link above explains the concept private void button1

Issue while saving image using savefiledialog

扶醉桌前 提交于 2019-12-02 04:26:28
I'm using savefiledialog to save an image. Canvas is picturebox and the loaded image is bitmap. When I try to save it the file is created but somehow corrupted. Cause when I try againt load the image or show in different viewer it doesn't work - I mean the saved file is corrupted. There is an method for saving image. private void saveFileDialog1_FileOk(object sender, CancelEventArgs e) { System.IO.FileStream fs = (System.IO.FileStream)saveFileDialog1.OpenFile(); try { switch (saveFileDialog1.FilterIndex) { case 1: canvas.Image.Save(saveFileDialog1.FileName, System.Drawing.Imaging.ImageFormat

Displaying Save File Dialog in Asp.net web page

淺唱寂寞╮ 提交于 2019-12-02 02:46:57
I have a ASP.net page which writes a file to the local disk. I want to present the user a Save File dialog box and allow him to set the path to the folder. I know code like below can be used; Response.Clear(); Response.ContentType = "text/csv"; Response.AddHeader( "Content-Disposition", "attachment;filename=\"report.csv\"" ); // write your CSV data to Response.OutputStream here Response.End(); But it fixes filepath. I need to capture the filepath that the user selects. Is that possible in ASP.net? Thanks. it does not work like that from a web page, you have to initiate the download suggestiong

FileStream can't access the file because it's being used by another process

大兔子大兔子 提交于 2019-12-01 21:38:05
I'm new at web app in ASP.NET and I came across this problem. I have a page whe there is a Button to download a template.xls that is previously stored at a SharePoint page. I have the download method and it's working just fine. The template in question is being saved where it should be, on a folder where my web app is located, on my local IIS. The problem is to open this file to the end user. I need a popup to be displayed to the user, so he can open/save this template.xls I'm using the following : //path on my local IIS where the file is located after the download string _strFolderApp = "~

When does Microsoft.Win32.OpenFileDialog.ShowDialog() return null?

五迷三道 提交于 2019-12-01 17:03:45
OpenFileDialog 's ShowDialog method returns a nullable boolean, set to true if the user clicked OK or false if he clicked Cancel. When does it return null ? The documentation does not say. lance This is stated in the questions linked below, but I'll mention here that Programming WPF (Chris Sells, Ian Griffiths) says: ShowDialog will always return true or false. ... Only after a dialog has been shown but before it's been closed is DialogResult null. Similar question: When would ShowDialog() return null? And: Why is DialogResult a nullable bool in WPF? According to the .NET reflector , Microsoft

When does Microsoft.Win32.OpenFileDialog.ShowDialog() return null?

随声附和 提交于 2019-12-01 15:00:41
问题 OpenFileDialog's ShowDialog method returns a nullable boolean, set to true if the user clicked OK or false if he clicked Cancel. When does it return null ? The documentation does not say. 回答1: This is stated in the questions linked below, but I'll mention here that Programming WPF (Chris Sells, Ian Griffiths) says: ShowDialog will always return true or false. ... Only after a dialog has been shown but before it's been closed is DialogResult null. Similar question: When would ShowDialog()

Forcing “Save As” dialog via jQuery GET

狂风中的少年 提交于 2019-12-01 10:39:30
I'm calling a jQuery "GET" on the test.php file code below. I'm trying to get the script to pop a "Save As" dialog on the resulting test.ini file to allow it to be saved locally. However, although I can echo the result back to the jQuery fine, I can't seem to pop the "save as" dialog. Update: Thanks to the solutions below, I just changed my $.get to a window.location.replace. $('#test').click( function() { //$.get('<?php echo get_bloginfo('template_directory') ?>/test.php'); window.location.replace("<?php echo get_bloginfo('template_directory') ?>/test.php"); } ); Jimmy Baker You can't get an

Change default arrangement of Save and Cancel buttons in SaveFileDialog

点点圈 提交于 2019-12-01 07:44:24
问题 I m coding in c# and I want to change the default arrangement of 'Save' and 'Cancel' buttons in SaveFileDialog. The default arrangement is that the 'Save' button is above the 'Cancel' button. What I want is to place 'Cancel' button on the right hand side of the 'Save' button. I searched over the web and found that the text on these buttons can be changed(to which the answer was on stackoverflow itself) and nothing found on changing their arrangements (locations). Please give me a solution if