upload photo from file or postman by image address in my drive

I have a schema like this:

const Person = new mongoose.Schema({
  username: {
    type: String,
    required: [true, "Name is a required field"],
    unique: [true, "Another Person with the same name already exists"],
    trim: true
  friends: [
      name: {
        type: String,
        required: [true, "Every friend must have a name"],
        unique: [true, "Another friend with the same name already exists"],
        trim: true
     photo: String,
     favoriteFood: String
  createdAt: {
    type: Date,
    default: Date.now()

I want to add an image for each friend, but I want to upload the photo from something like postman or a seeder file by adding image address in my hard drive in the request. because I have several friends, I have to make each photo specific for each friend. I want to do something like this in postman body or in a file as a seeder to fill database or add data to it.

"username": "aUsername",
"friends": [
     "name": "friend1",
     "photo": "./home/user/photos/photo1.jpg",
     "favoriteFood": "Pizza"
     "name": "friend2",
     "photo": "./home/user/photos/photo2.jpg",
     "favoriteFood": "Sushi"
     "name": "friend3",
     "photo": "./home/user/photos/photo3.jpg",
     "favoriteFood": "Hamburger"

how can I create this feature in the backend?


244 thoughts on “upload photo from file or postman by image address in my drive”

  1. Pingback: sildenafil 20mg
  2. Pingback: viagra cost
  3. Pingback: otc viagra
  4. Pingback: cialis for sale
  5. Pingback: female viagra
  6. Pingback: sildenafil 20 mg
  7. Pingback: sildenafil 50mg
  8. Pingback: cialis canada
  9. Pingback: sildenafil gel
  10. Pingback: viagraherse
  11. Pingback: cialis for women
  12. Pingback: sildenafil online
  13. Pingback: cheap viagra
  14. Pingback: online viagra
  15. Pingback: taking viagra
  16. Pingback: levitra vs viagra
  17. Pingback: cialis vs viagra
  18. Pingback: pfizer viagra
  19. Pingback: viagra naturel
  20. Pingback: viagra alternative
  21. Pingback: sildenafil citrate
  22. Pingback: what is viagra
  23. Pingback: viagra pills
  24. Pingback: herbal viagra
  25. Pingback: viagra for sale
  26. Pingback: roman viagra
  27. Pingback: cialis viagra
  28. Pingback: viagra usa
  29. Pingback: levitra vs cialis