我想从 One Drive 下载公共文件夹中的文件,但它不下载这些文件。
这是场景:
在公共文件夹中,我有另一个文件夹,其中包含多个文件,并且可以广泛访问。
出于测试目的,我共享了公共文件夹中的所有文件(如果这是正确的共享方式,我不会共享)。
以下链接可供我下载该文件:
- 来自共享文件夹链接
- 来自公共文件夹链接https://onedrive.live.com/redir?resid=DBBC281099F4FE69%21646 https://onedrive.live.com/redir?resid=DBBC281099F4FE69%21646
- 直接链接http://1drv.ms/1z9XlW6 http://1drv.ms/1z9XlW6 -
我在用BackgroundTransferRequest
使用以下代码下载文件:
string filePathToDownload = string.Empty, fileName = "111.mp3";
filePathToDownload = "http://1drv.ms/1z9XlW6";
Uri transferUri = new Uri(Uri.EscapeUriString(filePathToDownload), UriKind.RelativeOrAbsolute);
BackgroundTransferRequest transferRequest = new BackgroundTransferRequest(transferUri);
transferRequest.Method = "GET";
transferRequest.TransferPreferences = TransferPreferences.AllowCellularAndBattery;
Uri downloadUri = new Uri(DataSource.TEMPDOWNLOADLOCATION + fileName, UriKind.RelativeOrAbsolute);
transferRequest.DownloadLocation = downloadUri;
transferRequest.Tag = fileName;
该文件有 300Kb,但这仅下载 6 Kb。
如何直接从上面的链接(其中任何一个)下载文件?
thanks!
如果你替换这个词redir
with download
在 url 中,您将获得原始文件而不是网页,即
https://onedrive.live.com/download?resid=DBBC281099F4FE69%21646 https://onedrive.live.com/download?resid=DBBC281099F4FE69%21646
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)