Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.

Add file upload from local path for binary file support#34

Open
takachaa wants to merge 1 commit into
box-community:mainfrom
takachaa:feat/upload-from-local-path
Open

Add file upload from local path for binary file support#34
takachaa wants to merge 1 commit into
box-community:mainfrom
takachaa:feat/upload-from-local-path

Conversation

@takachaa
Copy link
Copy Markdown

@takachaa takachaa commented Mar 23, 2026

Summary

Changes

  • src/tools/box_tools_file_transfer.py: New box_file_upload_from_path_tool function that reads a local file in binary mode and uploads via existing box_file_upload()
  • src/tool_registry/file_transfer_tools.py: Register the new tool

How it works

The existing box_file_upload_tool requires content to be passed as str | bytes inline, which causes binary files to be corrupted when AI agents serialize them. The new tool takes a file path instead, reads the file in rb mode, and delegates to the existing upload function — preserving binary integrity.

Test plan

  • Upload a .pptx file via box_file_upload_from_path_tool — verified working
  • Upload a .xlsx file — verified working
  • Verify error handling for invalid/missing paths
  • Verify existing box_file_upload_tool still works unchanged

🤖 Generated with Claude Code

…munity#33)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add file upload from local path for binary files (.pptx, .xlsx, etc.)

1 participant