fileopendialog

Filter files in HTML file open dialog

放肆的年华 提交于 2020-01-29 18:09:32
问题 I am working with file upload to the server using HTML tag: <input type="file"> When I click on the browse button it shows me a file open dialog. Can I filter the files by passing the extension filter to that dialog? Like we can do in .Net framework's file open dialog by passing some thing like: Text files *.txt|.txt Using this filter we can only open .txt files. Other files not shown to the user. Is there any option for this dialog? 回答1: Standard Actually in HTML5 you can set the accept

When i open file first time file is opened but if choose the second time same file not opened how to do it in java swing?

只谈情不闲聊 提交于 2020-01-17 04:35:10
问题 Firstly open file through open menuitem but when second time open i choose the same file it opened in new tab. my requirement it not opened in new tab and display the message file already exist. Here is my code, public class Open extends javax.swing.JFrame { JTextArea tx; int i=0; public Open() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { tp = new javax.swing.JTabbedPane(); jMenuBar1 = new

Regular Expression Filter for QFileDialog

前提是你 提交于 2020-01-11 13:21:49
问题 I would like to display a file open dialog that filters on a particular pattern, for example *.000 to *.999 . QFileDialog::getOpenFileNames allows you to specify discrete filters, such as *.000 , *.001 , etc. I would like to set a regular expression as a filter, in this case ^.*\.\d\d\d$ , i.e. any file name that has a three digit extension. 回答1: It can be done by adding proxy model to QFileDialog. It is explained here: Filtering in QFileDialog 回答2: ariwez pointed me into the right direction.

How do I present an open folder selection dialog in Perl?

南笙酒味 提交于 2020-01-01 06:28:46
问题 How do I open folder selection dialog in Perl? 回答1: Depends on the GUI system you're using, and perhaps the platform. For example, on Windows and using Win32::GUI , you can use GetOpenFileName : # $main is your main window... $my_file = $main->GetOpenFileName( -title => 'Select a file...', -file => 'default.file', ); 回答2: Most portable (at least compared to others): use Tk; my $dir = Tk::MainWindow->new->chooseDirectory; Of course, if you're actually using Tk in the rest of your program, you

How do I present an open folder selection dialog in Perl?

喜夏-厌秋 提交于 2020-01-01 06:28:28
问题 How do I open folder selection dialog in Perl? 回答1: Depends on the GUI system you're using, and perhaps the platform. For example, on Windows and using Win32::GUI , you can use GetOpenFileName : # $main is your main window... $my_file = $main->GetOpenFileName( -title => 'Select a file...', -file => 'default.file', ); 回答2: Most portable (at least compared to others): use Tk; my $dir = Tk::MainWindow->new->chooseDirectory; Of course, if you're actually using Tk in the rest of your program, you

Browse for a File from Excel VBA

南楼画角 提交于 2019-12-22 10:26:46
问题 How can I put up a "File Open" dialog from some VBA running in Excel? I'm using Excel 2003. 回答1: You want the Application.GetOpenFilename function. Copying from VBA Object Browser: Function GetOpenFilename([FileFilter], [FilterIndex], [Title], [ButtonText], [MultiSelect]) Member of Excel.Application 回答2: Add a reference to ComDLG32.OCX and then something like... Sub PromptForFile() Dim d As New MSComDlg.CommonDialog d.Filter = "xls" d.Filename = "*.xls" d.ShowOpen Excel.Workbooks.Open d

How to open a default dialog for window if ShellExecute fails due to no file association in C++?

爷,独闯天下 提交于 2019-12-17 20:41:47
问题 I can use the windows ShellExecute function to open a file with no problems so long as the file has a correct association. If no association exists i would like to use the default windows dialog to open the file: Is this possible? If so how? 回答1: The documented way to show that dialog is to use the openas verb. CoInitializeEx(NULL, COINIT_APARTMENTTHREADED|COINIT_DISABLE_OLE1DDE); SHELLEXECUTEINFO sei = { sizeof(sei) }; sei.fMask = SEE_MASK_NOASYNC; sei.nShow = SW_SHOWNORMAL; sei.lpVerb =

OpenDialog does not show up in Delphi MultiThreaded application

女生的网名这么多〃 提交于 2019-12-12 09:06:53
问题 i tried to use the openDialog in new thread but it made so strange behavior .. if i put the if opendialog.execute then in the create constructor like this : constructor TChatMemberThread.Create(Name: string); begin inherited Create(True); FName := Name; FreeOnTerminate := True; Opendialog := TOpenDialog.create(nil); if opendialog.execute then for 0 to opendialog.filescount do somecodeishere end; end; the opendialog open normally but when i put it in the execute producer of the thread it didn

How to disable automatic appending of wildcard pattern in Vista file open dialog

喜夏-厌秋 提交于 2019-12-10 17:05:47
问题 I'm using a file open dialog to chose image files for further editing. The filter list contains an "All supported formats" entry which represents a long list of file formats. Since Vista automatically appends the wildcard patterns in the filter combobox, the expanded combobox is too wide to fit completely on the screen. Besides that it doesn't look very well. So is it possible to disable this behaviour and let Vista display the original filter string? Regards, Daniel 回答1: Vista only appends

Browse for a File from Excel VBA

走远了吗. 提交于 2019-12-05 21:16:26
How can I put up a "File Open" dialog from some VBA running in Excel? I'm using Excel 2003. You want the Application.GetOpenFilename function. Copying from VBA Object Browser: Function GetOpenFilename([FileFilter], [FilterIndex], [Title], [ButtonText], [MultiSelect]) Member of Excel.Application Add a reference to ComDLG32.OCX and then something like... Sub PromptForFile() Dim d As New MSComDlg.CommonDialog d.Filter = "xls" d.Filename = "*.xls" d.ShowOpen Excel.Workbooks.Open d.Filename Set d = Nothing End Sub 来源: https://stackoverflow.com/questions/221444/browse-for-a-file-from-excel-vba