WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

Right-Click Save As Changes Extension

Open MatthewJWalters opened this issue 3 years ago • 10 comments

Description We have a local html page with links to csv files (also stored locally). If I right-click the link to the csv file the save-as dialog has file extension options as Excel 97-2003 or all files and changes the extension to xls. (The file is saved as csv with an xls extension which then causes a warning when opening in Excel.

Version

Runtime: Evergreen install 97.0.1072.76 Framework: WinForms OS: Win 10 Enterprise 10.0.19042

Repro Steps Right-click a link to a file, select save-as. Expected behaviour - filename matches the link target. 2022-02-02 17_29_51-Window 2022-02-02 17_32_10-Window single_assembly.csv

AB#38086275

MatthewJWalters avatar Feb 03 '22 08:02 MatthewJWalters

Hey @MatthewJWalters - thanks for the bug report! Does it work as expected if you choose All files for the type?

champnic avatar Feb 03 '22 17:02 champnic

Hi, just checked and if I change it to all files the extension remains as xls unless manually changed. Out of interest I've reset the standard csv file association from Excel to Notepad but this didn't have any effect.

MatthewJWalters avatar Feb 03 '22 19:02 MatthewJWalters

I just tried my sample app navigated to this webpage and did "Save link as" on the .csv file you included, and it seems to work fine. Is it perhaps something about the way the link in your screenshot is setup? Are you sure it's a csv file and not an xls? image

champnic avatar Feb 03 '22 23:02 champnic

Hi, yes - the file attached in the original post is the file the link points to: image image image (In case it makes a difference my app is compiled as 32bit.)

MatthewJWalters avatar Feb 04 '22 07:02 MatthewJWalters

(If i just do a single left click the file is automatically downloaded as .xls)

MatthewJWalters avatar Feb 04 '22 07:02 MatthewJWalters

Devtools: image (Context menu 'save link as' isn't working when devtools is running, this was a left-click save)

MatthewJWalters avatar Feb 04 '22 08:02 MatthewJWalters

Strange!

If you point your app to this GitHub Issue page and use the link in your original post, does it still convert to .xls? If you go to your file in the browser (Edge and/or Chrome) instead of your app, what's the behavior there?

champnic avatar Feb 04 '22 18:02 champnic

Can you also check what the MIME type is specified as in the Content-Type header of the Response? What happens if you set type="text/csv" on the link?

champnic avatar Feb 04 '22 18:02 champnic

I'm only getting partial headers in the response in devtools. However, the file is being recognised as csv when i point it at a server rather than my local desktop version. As this is how it will function in production at our customer sites I'm not overly concerned.

If I set the type to text/csv the webview2 and full Edge both still try to use Excel to open it. Firefox id's the file as an Excel type file but offers to open it with the default program (notepad). 2022-02-07 09_18_46-Window 2022-02-07 09_22_41-Window

MatthewJWalters avatar Feb 07 '22 10:02 MatthewJWalters

Thanks for the info! I've added this as a bug on our backlog, but I'm glad your unblocked in the production scenario.

champnic avatar Feb 08 '22 06:02 champnic