code: def _copy(self, filename, id_=-1, file_type=0):
          
          if os.path.isdir(filename):
              raise JSSUnsupportedFileType(
                  "Distribution Server type repos do not permit directory "
                  "uploads. You are probably trying to upload a non-flat "
                  "package. Please zip or create a flat package.")
          basefname = os.path.basename(filename)
          resource = open(filename, "rb")
          headers = {"DESTINATION": self.destination, "OBJECT_ID": str(id_),
                     "FILE_TYPE": file_type, "FILE_NAME": basefname}
          response = self.connection["jss"].session.post(
              url=self.connection["upload_url"], data=resource, headers=headers)
          if self.connection["jss"].verbose:
              print response
docs: Upload a file to the distribution server.
  
          Directories/bundle-style packages must be zipped prior to
          copying.