简体   繁体   中英

strange downloading error (wp7+skydrive api)

If the filename contains # - download from skydrive fails. More precisely - length of result always 0. Other files are loaded without any problems;

Thanks

start downloading:

if (!loading) {
                if (!Storage.Exists(item.Name)
                    || MessageBox.Show(AppResources.alreadyExists, AppResources.confirmation, MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
                    loading = true;
                    App.loadInfo.Name = item.Name;
                    App.loadInfo.Info = AppResources.loadingStart;
                    PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disa bled;
                    client.DownloadAsync(item.Id + CONTENT, item);
                }
            }

download completed:

void client_DownloadCompleted(object sender, LiveDownloadCompletedEventArgs e) {
        PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
        try {
            FileItem item = e.UserState as FileItem;
            if (e.Error == null
                && !e.Cancelled
                && e.UserState != null
                && item.Size == e.Result.Length.ToString()) //LENGTH = 0 { Storage.SaveFile(item.Name, e.Result);
                App.loadInfo.Info = AppResources.loadingComplete;
                new GetIcon(item._name);
            }
            else {
                if (item != null) App.loadInfo.Name = item.Name;
                App.loadInfo.Info = AppResources.loadingError;
            }
        }
        finally { App.loadInfo.Progress = 0; loading = false; MakeUi(); }
    }

LiveDownloadProgressChangedEventArgs does not arise

如果确实是这种情况,您是否可以在发出请求之前不只是从URI中剥离片段?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM