Skip to content
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

Add Example: HTTP server: Upload file to Deno by Example #986

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

davis9001
Copy link
Contributor

@davis9001 davis9001 commented Oct 11, 2024

Created a TypeScript file in /examples to illustrate a very basic approach to using Deno.serve() to facilitate uploading files using HTML forms, along with a resource link to Fresh docs to do the same.

Note: I couldn't find any way around encoding the form HTML string to get it to show on the docs page: Lume or whatever isn't auto encoding in the <code> block. This also led me to find what I believe is another bug in Deno docs (or Lume? or codemirror?) not display the generic class (presumably because it's getting interpreted as an HTML element.)

Anyway to make sure the code actually works (and displays on the docs) I used @std/html/entities unescape() on the encoded HTML string before sending it off in the Response.

Closes #42

@davis9001
Copy link
Contributor Author

Request for review @thisisjofrank

@davis9001
Copy link
Contributor Author

Request for review @philhawksworth 🫡

@thisisjofrank thisisjofrank self-assigned this Nov 7, 2024
@thisisjofrank
Copy link
Collaborator

Thanks for this example! I'll take a look at how the examples pages are being generated and see if I can fix that html encoding bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add example code for file uploads in Deno by Example
2 participants