WebView has a method called
- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id < WebOpenPanelResultListener >)resultListener
But it has almost 0 documents and details. Inside, I open the open file dialog and get the selected file name.
Like this
- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id < WebOpenPanelResultListener >)resultListener { NSOpenPanel* openDlg = [NSOpenPanel openPanel]; [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:NO];
But then?
What should I do? On the website, it shows that I selected the file, but when you click on the download of the website, just return an error, for example, if the file is not downloaded. Should I write code that handles file upload or what?
I'm a little lost ...
Edit:
Actually I got it working ... Just changing the code from here: Cocoa webkit: how to access the file / file system in webkit a bit, as some part is out of date
- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id < WebOpenPanelResultListener >)resultListener {
Enjoy it!
Dimillian
source share