title: How to resolve the error related postman given below?
body: <p>in<a href="https://i.stack.imgur.com/fMN8B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fMN8B.png" alt="enter image description here" /></a>How to resolve the error given below?</p>
  <p><strong>FileEntity.java</strong> -Java Pojo class carrying data.</p>
  <pre><code>@Entity
  //table name
  @Table(name = &quot;file_details&quot;)
  public class FileEntity {
  
  @Id
  @GeneratedValue
  private String file_id;
  
  private String user_id;
  
  private String file_name;
  
  public String getFile_id() {
      return file_id;
  }
  
  public void setFile_id(String file_id) {
      this.file_id = file_id;
  }
  
  public String getUser_id() {
      return user_id;
  }
  
  public void setUser_id(String user_id) {
      this.user_id = user_id;
  }
  
  public String getFile_name() {
      return file_name;
  }
  
  public void setFile_name(String file_name) {
      this.file_name = file_name;
  }
  
  @Override
  public String toString() {
      return &quot;File_Details [file_id=&quot; + file_id + &quot;, user_id=&quot; + user_id + &quot;, file_name=&quot; + file_name + &quot;]&quot;;
  }
  }
  </code></pre>
  <p><strong>FileRepository.java</strong></p>
  <pre><code>@Repository
  public interface FileRepository extends JpaRepository&lt;FileEntity, String&gt; {
  
   @Query(&quot;select file from file_details file where file.user_id = ?1&quot;)
   List&lt;FileEntity&gt; findByUserId(String user_id);
  }
  </code></pre>
  <p><strong>MainController.java</strong>
  The controller which controls the flow of data</p>
  <pre><code>//Post request to upload file to the google drive and get id of the file uploaded to the drive
  @PostMapping(value = &quot;/upload/{user_id}&quot;)
  public ResponseEntity&lt;FileEntity&gt; uploadFIle(FileEntity fileEntity,@RequestParam(&quot;file&quot;) MultipartFile file,@PathVariable String user_id){
     //here I am getting field which I have stored on google drive
      String fileId = fileManager.uploadFile(file);
     //Here I am passing field id and userid which I want to store in db
      FileEntity updated = fileManager.createOrUpdateFile(fileEntity,fileId,user_id);
  return new ResponseEntity&lt;FileEntity&gt;(updated, HttpStatus.OK);
  }
  </code></pre>
  <p><strong>FileManager.java</strong> - service class which contains various functions.</p>
  <pre><code>public class FileManager {
  
  @Autowired
  private GoogleDriveManager googleDriveManager;
  
  @Autowired
  FileRepository fileRepository;
  </code></pre>
  <p><strong>uploadFile function</strong></p>
  <pre><code> public String uploadFile(MultipartFile file) {
      try {
          //String folderId = getFolderId(filePath);
          if (file != null) {
              File fileMetadata = new File();
              //fileMetadata.setParents(Collections.singletonList(folderId));
              fileMetadata.setName(file.getOriginalFilename());
              File uploadFile = googleDriveManager.getInstance()
                      .files()
                      .create(fileMetadata, new InputStreamContent(
                              file.getContentType(),
                              new ByteArrayInputStream(file.getBytes()))
                      )
                      .setFields(&quot;id&quot;).execute();
              String fileId = uploadFile.getId();
              return fileId;
          }
      } catch (Exception e) {
          System.out.print(&quot;Error: &quot;+e);
      }
      return null;
  }
  </code></pre>
  <p><strong>createOrUpdateFile</strong> function to store data to db</p>
  <pre><code>public FileEntity createOrUpdateFile(FileEntity fileEntity, String fileId, String user_id) {
      Optional&lt;FileEntity&gt; employee = fileRepository.findById(fileEntity.getFile_id());
      
      if(employee.isPresent()) 
      {
          FileEntity newEntity = employee.get();
          newEntity.setFile_id(fileId);
          newEntity.setUser_id(user_id);
          newEntity.setFile_name(fileEntity.getFile_name());
  
          newEntity = fileRepository.save(newEntity);
           
          return newEntity;
      } else {
          fileEntity = fileRepository.save(fileEntity);
           
          return fileEntity;
      }
  }
  </code></pre>
  <p>This project is to upload file to the google drive, and to get the id which identifies file stored in the google drive. And also we want to view file uploaded by the each user, So here we are storing file id and user id to the database to view the file.</p>