File saving issue Windows phone 8.1 - c#

I am facing the following issue while performing the save operation on a windows 8.1 phone
a. Let us assume there is a a file named test1.doc is downloaded to a default location in the sdcard. SDCARD - Testfolder
b. We try to edit/open the file using the office 365 present in the phone and try to save it. It does not save it in the same location i.e. TestFolder.
c. It prompts the user to save in the file in the default folder present in phone for eg in the above case since it is a .doc it saves in Documents folder.
Based on the file extension, it will try to save them in the respective default location i.e. mp3 will be saved under music, .jpg or png will be in picture, .mp4 under videos and .doc,.xls,.txt, ppt under documents.
Pl. refer to the below link
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn639127.aspx
d. And during save it also modifies the file name by appending (1) to the file. User is also given the option to modify the file name before saving.
Where on the tab and desktop it is allowing us to do the save on the same location.
I would like to know if it is a know limitation on the windows phone or any thing needs to be done to make the file save in the same location. Any input on this will be of great help.

That is the platform norm (I am not calling it as "limitation"). Every app has access to its own IsolatedStorage and media libraries depending on the access requested in manifest.

Related

Get Drive icon by mime type

I'm building a windows C# Drive App, and wish to display the thumbnails for a handful of folders.
For files that exist in a drive, I know you can get the icon by using the IconLink parameter.
How can I do this file that doesn't exist (yet), using the MimeType of the file?
If you have the file extension you can get this from the registry, for example:
HKEY_CLASSES_ROOT
.avi
On my machine, the (Default) value on that key is VLC.avi.
Now find the key with that name:
HKEY_CLASSES_ROOT
VLC.avi
And there you should find a subkey called DefaultIcon, which in my case has a (Default) value of "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe",0
From here you should be able to get the icon from .exe path.
Sometimes DefaultIcon contains the path to a .dll followed by an index. For these you could check this SO question for details on how to extract the image itself.
You may want to try Uploading thumbnails. As discussed,
For shortcuts and other file types that Drive can't render, you can provide a thumbnail image generated by your application. Upload a thumbnail by setting the contentHints.thumbnail property on the File resource during an insert or update call as follows:
Set contentHints.thumbnail.image to the URL-safe Base64-encoded image
Set contentHints.thumbnail.mimeType to the appropriate type for the image format
If Drive can't generate a thumbnail, it will always use yours if you provided one.
In addition to that, note that thumbnails are invalidated each time the content of the file changes. When supplying thumbnails, it is important to upload new thumbnails each time the content is modified.
Also, check suggested solutions in the following SO posts and see if it will help you:
Permanent links to thumbnails in Google Drive API
Unable to get thumbnail using Google Drive API

Windows Phone 8.0 - Access phone's local storage

Is there any API that enables me to access the phone's local storage files and folders ? I want to implement a file picker that displays the folders and files hierarchy just like they are in folder explorer:
Microsoft has released a free app called "Files" that does exactly what I want and more. Is it a special case or its possible for any developer?
Note: Im programming a WP8.0 app and not WP8.1. File Picker sample won't work for me! :)
There is no API in WP8 to list all the files in storage. In WP8 you can only access Audio and image files.
For more details refer this.

Save PDF file to isolated storage then launch - Windows phone

I have come to the stage in my app where I need to download a pdf file from a certain URL, save it to disk (on the phone that is), and then as soon as it's saved try and open the document in whatever application is installed on the phone to handle PDFs (Adobe reader).
I have a rather limited understanding of how to save to disk and launch a certain file with another application.
Can someone point me in the right direction or give me some tips on how to accomplish this?
My understanding of windows phone is quite limited and I need to quickly add this feature on the app.
In Windows Phone 7, it is not possible to programmatically start the PDF viewer (it's possible in Windows Phone 8 though). So the best I can suggest is using the WebBrowserTask to open the web browser directly at the PDF's URL, then let the user open the file.
It's definitely not a great user experience, but I've been unable to find any other way (even using a WebBrowser control directly in the app doesn't seem to work).
var task = new WebBrowserTask();
task.Uri = new Uri("http://www.education.gov.yk.ca/pdf/pdf-test.pdf");
task.Show();
Where you saved the PDF in Isolated Storage?
You directly opened the Online PDF file in WebBrowser.
Follow these steps:
1) Download the from URI
2) Save to the Isolation Storage
3) Launch it using the launcher.
Note: 1) If you are downloading the pdf file than use .pdf extension while storing in Isolation Storage.
2)Make sure you have the related software installed in your phone like Adobe for PDF etc.

WP7 -- finding isolatedStorage files on my computer

I am trying to use the C# class IsolatedStorageFile to write some data to a file in my app. This is using the simulator. I would like to look on my computer to see if it worked (i.e., look at the file in notepad). Where can I find that file?
The Isolated Storage is stored in the emulator, which is a virtual machine, and not directly on your harddrive. You'll have to code your own file viewer (e.g. from within your app, load the file from Isolated Storage and display the text using StreamReader).
I vaguely remember that the Mango toolkit (out in May) features an IsolatedStorage viewer built into the emulator, but I'm not sure what features it has.
You might be interested in this blog post. It explains how to export your file to your desktop.
You can download IsolatedStorageExplorer And use it to download file from IsolatedStorage to Computer.
Check out this Post and Answer given by Matt Lacey

opening or browsing for mp3 files in windows phone 7

im trying to create a mp3 player for windows phone 7...how do i create a open file dialog or something that will allow me to access my files on the phone so that i can play them with my app"???
EG:
say i have a folder in my sd card...how do i browse to that folder so that i can imports the songs from that folder into a playlist in my app...
There are no standard open file dialogs for WP7. (some choosers excepted.)
If you want to do this you'll have to create the dialog yourself. You can get the details of the songs saved into the Music&Video hub via the MediaLibrary object. (Add a reference to Microsoft.Xna.Framework.dll to use this from Silverlight.)
You'll then have access to lists (collections) of Albums, artists, playlists, songs, etc.
If you want to play tracks you've save in IsolatedStorage you can access these directly yourself.

Categories