Example 3 which is not using UploadBrowserFile works as expected:
- drag a file into the text area
- just the file contents is shown, not
[<file_name>](<file_contents>)
My setup is an InteractiveServer project using latest 0.8.12.
<CodeMirror6Wrapper @bind-Doc=@Text
AutoFormatMarkdown=@false
TabSize=@TabSize
IndentationUnit=@TabSize
Theme=@Theme
Language=@Language
LintDocument=@LintDocument
Setup=@Setup
UploadBrowserFile=@UploadBrowserFile
EmbedUploadsAsDataUrls=@false
PreviewImages=@false
FullScreen=@FullScreen
MaxHeight="60em">
private CodeMirrorLanguage Language = CodeMirrorLanguage.PostgreSql;
private readonly CodeMirrorSetup Setup = new() {
HighlightSelectionMatches = true,
ScrollToStart = false,
ScrollToEnd = false,
BindMode = DocumentBindMode.OnDelayedInput
};
private async Task<string> UploadBrowserFile(IBrowserFile file) {
using TextReader reader = new StreamReader(file.OpenReadStream());
return await reader.ReadToEndAsync();
}
Dropping the file my-perfect.sql with contents select * from table always ends up as:
[my-perfect.sql](select * from table)
I've already tried various combinations of settings and also a FileUploadController - to no avail, always the same result.
The only thing that seems to make it display the contents only, is not defining UploadBrowserFile=@UploadBrowserFile.
But that isn't helpful for my scenario as I need to do some validations and edits on the dropped SQL before it gets passed to the text area.
Any hints/ideas/suggestions on how to "catch" the SQL after it has been dropped and how to get the "raw" SQL to show up?
Example 3which is not usingUploadBrowserFileworks as expected:[<file_name>](<file_contents>)My setup is an
InteractiveServer projectusing latest 0.8.12.Dropping the file
my-perfect.sqlwith contentsselect * from tablealways ends up as:I've already tried various combinations of settings and also a FileUploadController - to no avail, always the same result.
The only thing that seems to make it display the contents only, is not defining
UploadBrowserFile=@UploadBrowserFile.But that isn't helpful for my scenario as I need to do some validations and edits on the dropped SQL before it gets passed to the text area.
Any hints/ideas/suggestions on how to "catch" the SQL after it has been dropped and how to get the "raw" SQL to show up?