dify icon indicating copy to clipboard operation
dify copied to clipboard

workflow files bug, can not upload file.

Open nihaocool opened this issue 2 years ago • 2 comments

image

image

nihaocool avatar Sep 05 '24 05:09 nihaocool

@Alixxxxxxx Hello there! I'm here to help you with any bugs, questions, or contributions while waiting for a human maintainer. Let's get this sorted out together!

I found a similar issue related to file uploads in Dify version 1. The problem might be due to the upload_file_id not being properly set for local files. Here's a relevant code snippet that checks if the file has a transfer_method of local_file and if it lacks an upload_file_id. If any file meets these conditions, the isFileLoaded flag is set to false, preventing the run button from being enabled:

const isFileLoaded = (() => {
  // system files
  const filesForm = forms.find(item => !!item.values['#files#'])
  if (!filesForm)
    return true
  const files = filesForm.values['#files#'] as any
  if (files?.some((item: any) => item.transfer_method === TransferMethod.local_file && !item.upload_file_id))
    return false

  return true
})()

To resolve this issue, ensure that the upload_file_id is correctly set for all local files before attempting to run the workflow [1].

Additionally, there are known limitations related to file uploads in Dify:

  1. The upload size limit for a single document is 15MB.
  2. The maximum number of files for a single batch upload is 5.
  3. Different subscription plans for the SaaS version limit batch upload numbers, total document uploads, and vector storage.
  4. There is a limit of 100 total documents for knowledge uploads, which can be adjusted in local deployments [2][3].

If these limitations are not the cause, you might want to check the configuration settings related to file uploads in both cloud and self-hosted environments [4][5][6].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 05 '24 06:09 dosubot[bot]

Please do not modify the template.

crazywoola avatar Sep 05 '24 06:09 crazywoola