I'm developing a Windows Phone 8.1 (non silverlight) project and i'm very new to the platform.
I'm having a really hard time trying to access a pdf file from the web and saving it to the phone. First, i searched for how to display the pdf file inside the app without saving it, and learned that it can't be done.
Then i searched for a way to download the file and save it localy. Every example i found ended it up in a dead end; i tried with WebClient, and found out that i must switch to HttpClient, i tried with IsolateStorageFile and found that i must use ApplicationDataContainer.
It's becoming really frustrating searching for simple things for hours and hours without any result.
Can someone point me to an example, or anything else ?
Downloading a file for the user means that you have to take care of a variety of things:
1) The app must stay responsive while the user waits for the download to complete.
2) You have to provide some kind of status information.
3) The download should continue if your app gets suspended (e.g.: the user hits the home button).
That's why big /unknown size or slow file downloads should be load off to a background task.
This article will provide you with a working example:
http://www.informit.com/articles/article.aspx?p=2229233&seqNum=6
Related
I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell
I'm developing a Chrome application where I want to do basic stuff with currently downloaded files(mostly I want to move them to a new location using an application or extension whichever is possible).
I'm able to get access to the image, audio, video file using the mediaGallery API of Chrome apps. Is there a possible way I can get access to and being able to move other format file from their current location to some other location using Chromium apps?
You certainly read the contents of any directory that the user has given you access to. And, once the user has done this, you can retain the entry so on subsequent executions you don't have to keep asking the user to select the directory. Then, once you have a file, you can use the file API to manipulate it.
This is in principle all the media API does, except that it comes with knowledge of some built-in media directories.
I've read in a few places that file upload progress is not supported in IE9.
However I notice that gmail has some sort of solution for it. I've read articles from a couple of years ago that it is a flash-based solution but when I got the inspector tool out, I couldn't see any flash objects. I'm wondering whether anything has changed in that time.
Is anybody able to describe how gmail has solved the 'file upload progress' problem in IE9?
I do not know how gmail does it, but one possible solution is to start the upload asynchronously (javascript, iframe, whatever) and then poll the upload progress regularly from the server.
Assuming you have some kind of session identifying the user, the upload is sent to the server which updates some progress variable in the user's session while the file is being transferred. At the same time, the client polls the progress variable once a second via separate AJAX calls to the server.
I need to show the server uploaded files in flex 4.5 for a web application to manage the uploaded files like upload, delete and open for preview.
Can anyone help me How to list the sever side files in Flex action script3.0?
You can't just let Flash player browse your server files. But you could create a workaround.
Make a script on the server which will give you the list of files located at the path you're looking for. Through basic POST you can ask for a list of files for a directory. Then you can display it in your flash side. But remember every actual action that happens to your files MUST happen on the serverside. Also BEWARE such things, because it's really easy to look up network requests that are made in browser, so you may end up with all of your files deleted one day. So make sure you implement some security stuff.
I'd like to try my hand at some Chrome Extension Development. The most I have done with extensions is writing some small Greasemonkey scripts in the past.
I would like to use localStorage to store some data and then reveal the data on a extension button click later on. (Its seems like this would be done with a popup page)
How do I run a script everytime a page from lets say http://www.facebook.com/* is loaded?
How do I get access to the page? I think based off my localStorage requirement I would have to go down the background_page route (correct?) Can the background page and popup page communicate across the localStorage?
UPDATE:
I'm actually looking to learn the "Chrome way". I'm not really looking to run an existing Greasemonkey script
Google actually has some pretty good documentation on creating extensions. I recommend thoroughly reading the following two articles if you haven't already done so:
http://code.google.com/chrome/extensions/getstarted.html
http://code.google.com/chrome/extensions/overview.html
If you want to give your extension access when the user browses to Facebook, you'll need to declare that in the extension's manifest.
Unless you're wanting to save data beyond the life of the browser process, you probably don't need to use local storage. In-memory data can just be stored as part of the background page.
Content scripts (which run when you load a page) and background pages (which exist for the duration of the browser process) can communicate via message passing, which is described here:
http://code.google.com/chrome/extensions/messaging.html
Overall, I'd suggest spending some time browsing the Developer's Guide and becoming familiar with the concepts and examples.
Chrome has a feature to automatically convert greasemonkey scripts to extensions!