Dojo file browse control (not upload) - file

I need a dojo form control which enables user to browse hard disk and point to file. I dont need to upload that file. JUst a file browser control. I have tried to google it but am unable to find a usable one.
I need a textbox and and a browse button, I want open file dialog to open when I hit browse. User selects the file and full path comes in the text box. I need the the content of textbox as data and not the file itself.

I've not seen anybody do this before.
You could put a plain <input type="file"> into your HTML, inside a form you never submit, and listen for the value of the input element changing.
But I don't think you'll get the full path (at least not in all browsers).
e.g. http://jsfiddle.net/RoystonS/LfMwD/

Related

How to open a generated file on Vaadin Flow?

On my app I want to open a generated PDF with PdfBox on a new tab, I have seen a couple of documentations but they are for old version of Vaadin or won't work in my case. I don't want to save it on the server or attach the file to any link or button, I want to write a method to automatically open it on a new tab.
PdfBox gives an option to save the file on an OutputStream, is there any way to open that OutputStream file on a new tab? Or at least download it without attaching it to an Anchor widget like Flow Viritin does?
The problem lies in the fact that because you don't want to save the file on the server, you cannot then have a direct url of said file to link to. You also cannot pass the pdf file as parameter to another View.
The solution is to store the pdf in the VaadinSession (as byte[] is probably easiest), and when the user then opens another tab by clicking a certain anchor/routerlink, that view will read the pdf from the VaadinSession and add the it to the view. (How to display pdf with Vaadin 14). Please remember to remove the pdf again from the VaadinSession :)

using protractor to do selenium automation test with windows upload file popup

Right now, i am doing an UIveri5 automation test. when clicking the button, windows file system dialog pop up, i would like to know how can i input the file that i want to upload and click the upload button to go back to the web page.
I have try the ways here, but all the ways didn't work. if someone know about this situation, please give me some advises, thanks a lot.
File upload is handled by the selenium/webdiver and happens the same way in every selenium-based framework - locate the input of type file and enter the path to the file. Then click the submit button.
You can use uiveri5 control locators to find the upload control and just chain with by.css('input[type="file"]) to locate the input. Locate the submit button in a similar way.

Getting IE Browser to open the File

I embed the default Internet Explorer in my win32-C Application via COM/OLE.
I display a web page having a link (anchor tag) to save/open a file.
When i click on the link, It does some processing in the background but does not give me a dialog box asking to save or open the file. From Fiddler I come to know that it is writing to the cache but not able to access it or show any popup.
I expect to see the dialog box asking me to either save or open the file (default)
If i do this from the IE browser then everything works fine.
EDIT : I tried a sample code in which I do get to see the Dialog Box providing me with the option of saving, opening the file although tallied everything with my code I still fail to see the box.
I was thinking of the Modeless Dialog Box issue but I can see a Message Box in my code. So modeless dialog box is not disabled.
Not able to get how to get it to work.
(Note: Please see the attached images)
EDIT: I edited the The EmbedBrowser Function in my code, my browser was not given a pointer to my IOleClientSite object
New Code :- http://paste.ubuntu.com/1062010/
But problem persists!
I figured out the issue.
The interface DWebBrowserEvents2's invoke method was implemented to not display the File download Box while downloading.
Modified it to allow the same.

ExtJS 3 export textarea content to a text file

I need to export the contents of an ExtJS TextArea to a text file. I searched around the documentation but I didn't find anything related to a textarea. Is this possible?
It would be also ideal to prepare the filename as well together with the ability to export the textarea content to the file.
Help is appreciated.
Thanks
You can't just save something from JS file into any place on user's local computer file system. It's huge security hole and it's just doesn't work this way. You have couple options however:
Send this information to your server and provide user with a link to a file. User clicks that link server will respond with the information - browser saves that data. You can even make so content will automatically be downloaded by the browser (well, by most of them anyway)
Or you can ask user to right click and copy this information into the clipboard.

How can I make a url embedded in the about dialog box appear as a hyperlink? (resource script .rc)

I have an application written in c that has no dialog box.
However, when you right click the icon you get a floating menu and from there you can choose the about option. This will open an about dialog box. I have inside a link to some webpage, that can be pressed- that will open a browser and navigate to the URL. However, I am unable to make that URL appear as a hyperlink (all that GUI related work is done via the resource .rc file only).
Does anyone know how to color that link in blue and underline to make it appear as a hyperlink through resource script only?
Thank you
I haven't tried this myself but it looks like you can use the CONTROL statement in the resource script to include the SysLink class (which requires common controls v6/Win XP, and will therefore mean you also need a manifest in your application). For more details see http://msdn.microsoft.com/en-us/library/bb760706%28VS.85%29.aspx.
However, you will need to handle the notification from the SysLink control in order to launch the browser and you would need to call InitCommonControlsEx() before the dialog resource is used. That might stop all your GUI work being done by the rc file.
Another alternative would be to register a new window class, subclass from the SysLink control and customise the window message that would normally send the click notification to the parent in order to launch the browser. You could then use your custom class name in a CONTROL statement in the rc file. You still have more work to do but all the GUI handling would be done for you.

Resources