AIGC网盘 - 获取文件信息

获取AIGC网盘中指定文件的详细信息,包括元数据、访问统计等

Overview

This node retrieves detailed information about a specific file stored in the AIGC Network Disk service. It is useful when you need to obtain metadata such as file size, type, URLs for access or preview, upload time, and expiration status of a file by providing its unique file ID.

Common scenarios include:

  • Verifying file details before processing or sharing.
  • Displaying file metadata in workflows that manage files.
  • Checking if a file is expired or still accessible.

For example, after uploading a file to the AIGC Network Disk, you can use this node to fetch its metadata for logging or further automation steps.

Properties

Name Meaning
文件ID The unique identifier of the file to query. This ID can be obtained from file lists or upload responses. Example: abc123def456

Output

The node outputs an array of JSON objects, each representing the result for one input item. Each output JSON contains:

  • success: Boolean indicating if the request was successful.
  • data: The full raw response data returned from the AIGC Network Disk API about the file.
  • operation: The operation performed, here always "getFileInfo".
  • fileId: The queried file ID.
  • quickInfo: A summarized object with key file details:
    • id: File identifier.
    • filename: The file name or original name.
    • fileSize: Size of the file in bytes (0 if unavailable).
    • fileType: Type of the file (e.g., MIME type or "unknown").
    • url: Direct URL to access the file.
    • previewUrl: URL for previewing the file.
    • isExpired: Boolean indicating if the file has expired.
    • uploadTime: Timestamp of when the file was uploaded.
  • message: A success message confirming retrieval.

If the node encounters an error, it throws an error with a descriptive message or returns an error object if configured to continue on failure.

Dependencies

  • Requires an API authentication token credential for the AIGC Network Disk service.
  • The node makes authenticated HTTP GET requests to the endpoint /api/files/{fileId} of the AIGC Network Disk API.
  • Proper configuration of the API credential in n8n is necessary for successful execution.

Troubleshooting

  • Empty or missing file ID: The node will throw an error if the file ID parameter is empty or only whitespace. Ensure the file ID is correctly provided.
  • File not found (404): Indicates the specified file ID does not exist. Verify the file ID is correct and the file has not been deleted.
  • Access denied (403): The API token lacks permission to access the file. Check API credentials and permissions.
  • Invalid or expired API token (401): The authentication token is invalid or expired. Renew or update the API token credential.
  • Server errors (5xx): Temporary server issues may cause failures. Retry after some time.
  • Network or connectivity issues: Ensure network access to the AIGC Network Disk API endpoint.

Links and References

Discussion