使用 WebDAV COPY API 複製相同資料夾中的檔案時,出現 403 錯誤您好 DriveHQ,
我是對WebDAV有興趣的開發人員 DriveHQ!
最近我想寫一些程式碼來操作 DriveHQ 貯存。
很高興我可以利用 Python 的 requests 函式庫來操作 DriveHQ 貯存。
例如,我可以使用 WebDAV API 與…進行交互 DriveHQ 例如,使用 PUT 上傳文件,使用 GET 下載文件,使用 MKCOL 建立資料夾等等。
但是,我有一個疑問:當我使用 COPY 命令複製同一資料夾中的檔案時,會收到 403 錯誤!如果我使用 COPY 命令複製文件到… 不同的 文件夾,它能用!
(1複製到同一資料夾
輸入網址: https://dhqidpi45y1rxclpikdpvqc。webdav.drivehq.com:443/a.txt
輸入法: 複製
輸入頭: {'headers': {'Destination': 'https://dhqidpi45y1rxclpikdpvqc。webdav.drivehq.com:443/b.txt', '覆蓋': 'T'}}
輸出程式碼: 403
輸出頭: {'Content-Length': '0', 'X-AspNet-Version': '4.0.30319', 'Expires': '0', 'X-Powered-By': 'ASP.NET', 'Server': 'Microsoft-IIS/8.5', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache, no-store, must-revalidate,no-cache', 'Date': 'Tue, 08 Mar 2016 08:50:54 GMT)', 'Content-Type'}
(2複製到另一個資料夾
輸入網址: https://dhqidpi45y1rxclpikdpvqc。webdav.drivehq.com:443/a.txt
輸入法: 複製
輸入頭: {'headers': {'Destination': 'https://dhqidpi45y1rxclpikdpvqc。webdav.drivehq.com:443/tmp/b。TXT', '覆蓋': 'T'}}
輸出程式碼: 201
輸出頭: {'Content-Length': '0', 'X-AspNet-Version': '4.0.30319', 'Expires': '0', 'X-Powered-By': 'ASP.NET', 'Server': 'Microsoft-IIS/8.5', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Date': 'Tue, 08 Mar 2016 08:55:27 GMT', 'Tue, 08 Mar 2016 08:55:27 GMT', 'Content-html'}
請問為什麼使用 COPY 指令將一個檔案複製到同一路徑下的另一個檔案會被禁止?
將要 DriveHQ 未來是否支援 WebDAV 操作的同路徑複製?
非常感謝!