Solved

HTML5 Local Files Read / Read local files from Mobile App

Posted on 2012-04-02
3
767 Views
Last Modified: 2012-05-16
Is this possible within an HTML5 Web page script (hereafter referred to as the App).

1. Be able to designated a local directory on my computer that would be a repository of files that I upload.  This location would be stored on the client side (locally) within my App.

2. Files that I download from a server would be placed into this directory. These files would be images, videos, xml text documents, or smaller script files.  As they are uploaded an entry would be made into a local client side DB that would store the title, file name, description and file type.

3. When the App first loads (or after changes to the contents of the local directory), it would go to this local directory and read the names of these files and compare them to the client side DB.  These would be stored so that when the "Resources" button on the App is clicked, it lists out these files and give an "action" button that would allow me to view these files.  So if it's a movie, it would start playing.  If it is a picture it would display the image.  If it is an xml file, it would display the contents according to pre-determined parameters.

So bottom line, I am wondering if via HTML5 I can read the contents of a directory, compare them to a local DB to get more details and then display then take action: If a movie, play it; an image, show it; an XML file, display it with appropriate formatting; a script, execute it.

The application I'm thinking of using this would be to upload files to your mobile phone in a designated directory.  The local machine gives the option of picking one of these files to run. It would be a type of "modular" approach where each person's App would look a little different based on what he chooses to put into his local directory.  For some people, they would put five movies, ten images and an xml file with the contents of a formatted article.

So, I'm wondering if this is possible and if so, can you point me in the direction of where to understand how to do this.

Thanks.
0
Comment
Question by:pkonstan1
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 100 total points
ID: 37797303
All current browsers block access to the local file system from pages that are loaded remotely.  This is security based on the "same domain policy".  Pages loaded with "http://" are not allowed access pages accessed thru "file://".  This is to prevent malicious web sites from stealing info from your computer.
0
 

Assisted Solution

by:pkonstan1
pkonstan1 earned 0 total points
ID: 37814091
Let me clarify what I'm trying to do...

1. I want to be able to save files to my local device (save to a mobile phone, tablet or computer).  Typically these files would come from a Web download, but they may occassionally be emailed to me.  In any case, I save them to a local folder.

2. Then I want to be able to use an App (on the mobile device) or a local Web Page (on my computer) to then access those files.  If it's a video, it plays the video, if a HTML file, it displays it as HTML, for audio, it plays it.  

So basically its a way to be able to download content to a device that I can then later play in an offline mode.  It would be like a bookshelf where content can be placed and later viewed offline.
0
 

Author Closing Comment

by:pkonstan1
ID: 37974377
I was hoping for additional feedback, but in the absense of additional comments, I am closing this question.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now