如果应用程序安装在SD卡上,BackgroundDownloader无法将图像保存为SD [WinRT - Windows Phone 8.1] [英] BackgroundDownloader can not save image to SD if app is installed on SD card [WinRT - Windows Phone 8.1]

查看:69
本文介绍了如果应用程序安装在SD卡上,BackgroundDownloader无法将图像保存为SD [WinRT - Windows Phone 8.1]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开发一个使用BackgroundDownloader类下载和保存图像的应用程序。但是,当应用程序安装在SD上时,它不会下载图像,而是保存0字节文件。我使用以下设置位置:

I am developing an app that downloads and saves images using the BackgroundDownloader class. However when the app is installed on the SD, it does not download the images and instead saves a 0 byte file. I am using the the following to set the location:

 StorageFolder savedPicturesFolder = await KnownFolders.PicturesLibrary.CreateFolderAsync(MYFOLDERNAME, CreationCollisionOption.OpenIfExists);

以下方案执行工作: 

The following scenarios do work: 


  • 应用程序安装在SD卡上,图片设置为保存在手机上
  • 应用程序安装在手机上,图片设置为保存在手机上
  • 应用程序安装在手机上,图片设置为保存在SD卡上

以下方案工作:


  • 应用程序安装在SD卡上,图片设置为保存在SD卡上

即使我不需要,因为我在KnownFolders中保存,我增加了"可移动存储"功能。和.jpeg(image / jpeg)的文件类型关联。但这没有帮助。这是一个已知的问题,保存到SD卡还是我错过了
的东西? 

Even though I shouldn't need to, as I am saving in KnownFolders, I added the capability "Removable Storage" and a File Type Associations for .jpeg (image/jpeg). But this didn't help. Is this a known problem with saving to the SD card or am I missing something? 

感谢先进的任何建议。 

Thanks in advanced for any advice. 

推荐答案

您好Strucign,

Hi Strucign,

欢迎光临开发通用Windows应用程序
论坛!

在Windows Phone 8.0中,它支持对SD卡的只读访问,但在Windows Phone 8.1中,它提供对SD卡的读/写访问权限。所以我们可以把文件写入SD卡,因为我没有你的代码,所以先试着检查一下这篇文章:

访问Windows Phone应用程序中的SD卡
以确保您已注册与您要在Manifest中的声明部分中读取和写入的媒体类型相关联的文件扩展名。此外,我建议你利用

FutureAccessList
。它允许您重用用户以前授予您访问权限的文件和文件夹。有关详细信息,请参阅:
$
http://stackoverflow.com/questions/17502199/c-sharp-windows-store-backgrounddownloader-to-removable-storage

In Windows Phone 8.0 it supports read-only access to the SD card, but in the Windows Phone 8.1 it provides the read/write access to the SD card. So we can write file to the SD card, since I do not have your code, first try to check this article: Access the SD card in Windows Phone apps to make sure that you have registered the file extensions associated with the type of media that you want to read and write in Declaration part in Manifest. Besides, I will recommend you take advantage of FutureAccessList. It allows you to reuse files and folders that the user has previously granted you access to. For more information, please try to refer to:
http://stackoverflow.com/questions/17502199/c-sharp-windows-store-backgrounddownloader-to-removable-storage .

如果更好的话你可以尝试在这里发布一个简单的转载项目。



最好的问候,

Amy Peng

It will be better if you can try to post a simple reproduced project in here.

Best Regards,
Amy Peng


这篇关于如果应用程序安装在SD卡上,BackgroundDownloader无法将图像保存为SD [WinRT - Windows Phone 8.1]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆