AIGC网盘 - 删除文件

删除AIGC网盘中的指定文件,支持安全确认和删除前验证

Overview

This node deletes a specified file from the AIGC Network Disk service. It is designed to securely remove files by requiring explicit user confirmation before deletion, preventing accidental data loss. This node is useful in workflows where automated cleanup of files is needed, such as removing temporary uploads, managing storage quotas, or deleting outdated documents.

Practical examples:

  • Automatically delete files after processing them in a workflow.
  • Remove user-uploaded files upon request or after a certain period.
  • Clean up files that failed validation or are no longer needed.

Properties

Name Meaning
文件ID The ID of the file to delete. This can be obtained from file listings or upload responses.
确认删除 Whether to confirm deletion of this file (deletion is irreversible). Must be set to true to proceed with deletion.

Output

The node outputs an array of JSON objects, each corresponding to an input item processed. Each output JSON contains:

  • success: Boolean indicating if the deletion was successful.
  • data: The response data returned from the API after deletion.
  • operation: The string "deleteFile" indicating the performed operation.
  • fileId: The ID of the deleted file.
  • message: A success message confirming file deletion.

If an error occurs and the node is configured to continue on failure, the output JSON will include an error field with the error message and the operation name.

Dependencies

  • Requires an API key credential for authenticating requests to the AIGC Network Disk API.
  • The node makes HTTP DELETE requests to the endpoint /api/files/{fileId} of the AIGC Network Disk service.
  • Proper configuration of the API authentication credential within n8n is necessary.

Troubleshooting

  • Common issues:

    • Forgetting to enable the "确认删除" (confirm deletion) property will cause the node to throw an error to prevent accidental deletions.
    • Providing an empty or whitespace-only file ID will result in an error.
    • Insufficient permissions to delete the file (e.g., trying to delete files uploaded by others) will cause a permission error.
    • Using an invalid or expired API token will cause authentication failures.
  • Error messages and resolutions:

    • "请确认删除操作,这将永久删除文件!请选择\"确认删除\"选项。"
      Cause: Confirmation checkbox not enabled.
      Resolution: Enable the confirmation option to proceed.
    • "文件ID不能为空"
      Cause: File ID is missing or empty.
      Resolution: Provide a valid file ID.
    • "文件不存在,文件ID: {fileId}"
      Cause: The specified file does not exist.
      Resolution: Verify the file ID is correct.
    • "没有权限删除该文件(只能删除自己上传的文件)"
      Cause: User lacks permission to delete the file.
      Resolution: Ensure you have rights to delete this file.
    • "API Token无效或已过期"
      Cause: Authentication token is invalid or expired.
      Resolution: Update or reauthenticate the API token.
    • "服务器内部错误,请稍后重试"
      Cause: Server-side error.
      Resolution: Retry after some time or contact support if persistent.

Links and References

Discussion