So what I want is simply a button on a webpage that opens a local file browse dialog.
I don't want to upload the file anywhere, I just want it's path.
I know there is a file upload control but I don't want to use it because I don't want the textbox that goes with it and I also don't want the button to say "Browse".
I tried to use System.Windows.Forms.OpenFileDialog but it throws this error: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
Is there anyway to do what I want?
I don't want to upload the file anywhere, I just want it's path.
I know there is a file upload control but I don't want to use it because I don't want the textbox that goes with it and I also don't want the button to say "Browse".
I tried to use System.Windows.Forms.OpenFileDialog but it throws this error: Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
Is there anyway to do what I want?