title: How to upload image or file as backend
body: <p>I don't know how to upload image or file in Go. Here I share my code</p>
  <p>this is my repository, what i must change or add more code?</p>
  <pre><code>func (db *reportConnection) CreateReport(report entity.Report) entity.Report {
      db.connection.Save(&amp;report)
      db.connection.Preload(&quot;User&quot;).Find(&amp;report)
      return report
  }
  </code></pre>
  <p>this is my service, what i must change or add more code?</p>
  <pre><code>func (service *reportService) Create(r dto.ReportCreateDTO) entity.Report {
      report := entity.Report{}
      err := smapping.FillStruct(&amp;report, smapping.MapFields(&amp;r))
      if err != nil {
          log.Fatalf(&quot;failed map %v: &quot;, err)
      }
      res := service.reportRepo.CreateReport(report)
      return res
  }
  </code></pre>
  <p>this is my controller, what i must change or add more code?</p>
  <pre><code>func (c *reportController) Create(ctx *gin.Context) {
      var createReport dto.ReportCreateDTO
      err := ctx.ShouldBind(&amp;createReport)
      if err != nil {
          response := response.BuildErrorResponse(&quot;Failed to process!&quot;, err.Error(), response.EmptyObj{})
          ctx.AbortWithStatusJSON(http.StatusBadRequest, response)
      } else {
          authHeader := ctx.GetHeader(&quot;Authorization&quot;)
          userID := c.GetUserIDByToken(authHeader)
          convertUserID, err := strconv.ParseUint(userID, 10, 64)
          if err == nil {
              createReport.UserID = convertUserID
          }
          result := c.reportService.Create(createReport)
          response := response.BuildResponse(true, &quot;OK!&quot;, result)
          ctx.JSON(http.StatusOK, response)
      }
  }
  
  ```
  </code></pre>
  <p>i think i need to set a header, but not sure how</p>