Skip to content

Example of sending the image file from .net 8 to bun server

Notifications You must be signed in to change notification settings

tomaszzmudzinski/bun-net-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

There are two api applications

  1. Web API written in .net 8 (c#) - we're trying to send request with image as a file in formdata to second application. Second app will convert and optimize the image and return webp in the response.

  2. Http server written in bun - here we have one endpoint, it tries to get image file from formdata and convert it via sharp npm package. Then return result in the response if everything goes ok.

There are two scenarios:

  1. If we send the image via Web Api written in .net 8 - it looks like bun has some problems with encrypting file (maybe it can't handle it's format)

  2. If we send exactly the same image via Postman - it looks like bun works like a charm

How to run example apps:

In order to run web api written in .net 8 I recommend to use https://www.jetbrains.com/rider/ open the solution and hit green triangle here: image

Bun server runs on port 3005, just open bun folder in VS Code and run command in terminal: bun run dev

About

Example of sending the image file from .net 8 to bun server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published