#Upload Images

3 messages · Page 1 of 1 (latest)

upper fog
#

Hi guys, im struggeling with i belive trivial problem for many of you. i'm trying to upload images from some inputs with info, all by <form> in next. I have been searching some good solution in the internet since 3 days all i founded is based on instalall dozens of npm's (like themes in wordpress) its not nice i think. Im using MongoDB and Mongoose but i want to have files on my server (now it can be only cataloge in my nex filesystem) with link send to MongoDB data base. This is for my real estate CRM. I wanna to add some info about property and send e.g 10 photos. Thanks a lot for Your help.

sterile hinge
tender thicket
#

Its easy with just formidable and fs you can upload images to your server , and also to make use of the uploaded images you save the name of the image file to your mongodb then you create an api like this /api/[...slug].js along with it this way you can have your images and use them like this

<Image src={"http://yoursite.com/api/images/imagename.jpg"}

/>

I also spent days 😂 but it was fun now its a normal routine