# upload-suanni-file **Repository Path**: rymaker/upload-suanni-file ## Basic Information - **Project Name**: upload-suanni-file - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-25 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 文件批量上传脚本 自动将 E:\aimodel 目录内的所有文件上传到 https://sumw.com.cn/consoles/fileStorage ## 要求 - Python 3.8+ - Selenium (`pip install selenium`) - Google Chrome 浏览器 - 已登录到 https://sumw.com.cn/ ## 使用方法 ### 方法 1: 使用 PowerShell (推荐) ```powershell .\run_upload.ps1 ``` 脚本会自动: 1. 检查 Python 和依赖 2. 询问是否启动 Chrome 3. 启动带调试模式的 Chrome 4. 开始上传文件 ### 方法 2: 手动启动 **第一步:启动 Chrome 调试模式** 在命令行运行: ```cmd chrome.exe --remote-debugging-port=9222 ``` 或运行 `start_chrome.bat` **第二步:运行 Python 脚本** ```cmd python upload_files.py ``` ## 工作原理 1. 脚本连接到已启动的 Chrome 浏览器 2. 导航到文件存储页面 3. 逐个上传 E:\aimodel 中的文件 4. 每次上传一个文件(根据文件大小自动等待) 5. 上传完成后显示总结 ## 注意事项 - ⚠️ Chrome 必须已登录到 https://sumw.com.cn/ - 每个文件上传一次,上传之间自动等待 3 秒 - 大文件可能需要较长时间上传,脚本会自动调整超时时间 - 不要在上传过程中手动关闭 Chrome ## 文件说明 - `upload_files.py` - 主要上传脚本 - `start_chrome.bat` - 启动 Chrome 调试模式 - `run_upload.ps1` - PowerShell 运行器(自动处理所有步骤) ## 故障排除 ### 无法连接到 Chrome - 确保 Chrome 使用 `--remote-debugging-port=9222` 启动 - 关闭所有 Chrome 实例,重新启动 ### 文件未上传 - 检查 E:\aimodel 目录是否存在 - 确认用户有文件夹的读取权限 - 检查文件是否被其他程序占用 ### 超时错误 - 增加脚本中的超时时间 - 检查网络连接 - 确保已登录网站 ## 配置 如需修改上传目录或目标 URL,编辑 `upload_files.py` 中的: ```python source_directory = r"E:\aimodel" # 修改源目录 target_url = "https://sumw.com.cn/consoles/fileStorage" # 修改目标 URL ```