func (h *fileUploadHandler) Post(job rest.Job) (bool, error) {
	if err := job.Request().ParseMultipartForm(defaultMaxMemory); err != nil {
		return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
	}
	for _, headers := range job.Request().MultipartForm.File {
		for _, header := range headers {
			logger.Infof("receiving file %q", header.Filename)
			// Open file and process it.
			if infile, err := header.Open(); err != nil {
				return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
			} else if err := h.processor(job, header, infile); err != nil {
				return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
			}
		}
	}
	return true, nil
}
// Post is specified on the PostResourceHandler interface.
Post is specified on the PostResourceHandler interface.
// Post is specified on the PostResourceHandler interface .
func (h *fileUploadHandler) Post(job rest.Job) (bool, error) {
	if err := job.Request().ParseMultipartForm(defaultMaxMemory); err != nil {
		return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
	}
	for _, headers := range job.Request().MultipartForm.File {
		for _, header := range headers {
			logger.Infof("receiving file %q", header.Filename)
			if infile, err := header.Open(); err != nil {
				return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
			} else if err := h.processor(job, header, infile); err != nil {
				return false, errors.Annotate(err, ErrUploadingFile, errorMessages)
			}
		}
	}
	return true, nil
}
func ( h * fileUploadHandler ) Post ( job rest . Job ) ( bool , error ) { if err := job . Request ( ) . ParseMultipartForm ( defaultMaxMemory ) ; err != nil { return false , errors . Annotate ( err , ErrUploadingFile , errorMessages ) } for _ , headers := range job . Request ( ) . MultipartForm . File { for _ , header := range headers { logger . Infof ( " " , header . Filename ) if infile , err := header . Open ( ) ; err != nil { return false , errors . Annotate ( err , ErrUploadingFile , errorMessages ) } else if err := h . processor ( job , header , infile ) ; err != nil { return false , errors . Annotate ( err , ErrUploadingFile , errorMessages ) } } } return true , nil }
Post is specified on the PostResourceHandler interface.
Post is specified on the PostResourceHandler interface .
// Open file and process it.