4201VitruvianBots / VitruvianManufacturing

An application that allows users to keep track of parts throughout the design and manufacturing stages.
2 stars 1 forks source link

Update file submissions to store to the database #76

Open NathanDuPont opened 1 year ago

NathanDuPont commented 1 year ago

Once we get our files to save to the backend server, we need to save them to the database. This is going to be a little bit more of a tricky task but will add an important feature that will be needed in our final app.

Our database can't directly store images - images are a complex type of data, and it's too much for our database to understand and handle properly. Instead, we need to transform our image to another format before saving it. We can use a special technique called "base64 encoding", which allows us to take an image and save it as a string of text data, which our database can easily handle. Once we turn it into a string and save it to our database, we can then read it back out and convert the string back into an image when we want to show it in our table. This allows us to allow the machinists to see the image of what they're making, with minimal effort!