-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropping file with UploadBrowserFile always surrounds the file content with a markdown link #196
Comments
Hi @wilhelmberg, The next release will feature a new parameter that will give you control over how dropped (or pasted) files should be handled : either upload them, or insert their contents into the editor - if possible, i.e. if it's a text file (or empty MIME type) (else they'll get uploaded if the callback exists). Let me know if this doesn't match your specific needs. The reason of your bug (markdown link containing the contents) is that your So you'll need some kind of back-end storage for the uploaded files, and another endpoint to download the file. This should probably be added to the examples at some point, for clarity. Speaking of which, don't use the lazy and naive approach implemented in my examples (storing file contents within the document as data-URLs) in a "real" project, because it causes display bugs, makes the document very heavy (in Blazor Server the whole document gets transferred on each keystroke), easily breaking the Blazor signal-R connection to the server. |
Hi @gaelj, thanks for your swift reply, clarifications and new features 🎉👏 Being able to decide whether the files should be uploaded or inserted sounds great. My current workaround in Thanks for the hint about the document being transferred to each keystroke. |
Hi @gaelj, Another question: |
Example 3
which is not usingUploadBrowserFile
works as expected:[<file_name>](<file_contents>)
My setup is an
InteractiveServer project
using latest 0.8.12.Dropping the file
my-perfect.sql
with contentsselect * from table
always 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?
The text was updated successfully, but these errors were encountered: