wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes HTML 5 File API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "HTML 5 File API" Watch "HTML 5 File API" New topic
Author

HTML 5 File API

Sneha Patani
Greenhorn

Joined: Jul 31, 2011
Posts: 6
The File API of HTML5 gives information about file at client side using javascript. Is it a cross browser solution??Does IE support this?? If no, is there any way that I could use it in all browser especially in IE
Sergey Zhuravel
Greenhorn

Joined: Jan 27, 2012
Posts: 10
Hi Sneha. I hope all HTML5 stuff should be supported with all magor browsers in the nearest future. About IE as far as I know Internet Explorer 10 using JavaScript introduces support for File API. More details you can check in the ms msdn here. Also there are some js libratries that makes some HTML5 functionalities available in old browsers, so maybe the File API can work in the IE8-9 at least.
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 296
    
    5

The File API has at least some support in the latest releases of all the major desktop browsers.


Read my books: Hello! HTML5 & CSS3 | HTML5 in Action | Read my blog
Sergey Zhuravel
Greenhorn

Joined: Jan 27, 2012
Posts: 10
@Rob As far as I know JavaScript has some restrictions working with local files due to security reasons. In HTML5 we have more and more functionality for JS scripts, but is it good from security side? How HTML5 stuff makes applications more powerfull and secure in the same time? or security is poor with HTML5?
Rob Crowther
author
Ranch Hand

Joined: Nov 06, 2012
Posts: 296
    
    5

JavaScript is completely restricted from working with the local filesystem, you can't even set the value of an <input type="file"> from JavaScript. The File API does not allow unfettered access to the file system, only a domain specific sandbox. The setup is similar to the local file access allowed to iPad apps.

More functionality always means more opportunity for security mistakes, HTML5 doesn't get any special favours in this regard. If you want a totally secure system then disconnect it from any network and run it off a read only filesystem, but you would be limited in what you could achieve with such a system. I can say that in my experience security issues are a high priority in the thinking of the people writing the specs and the people creating the browsers (often the same people), every effort is made to ensure the specs are not fundamentally insecure and browsers have secure default behaviour.
Sneha Patani
Greenhorn

Joined: Jul 31, 2011
Posts: 6
Thank you for your reply, it seems like File API isn't supported in IE8 and IE9.
Here is the list of properties and features of HTML5 and CSS3 supported across browsers.
Sergey Zhuravel
Greenhorn

Joined: Jan 27, 2012
Posts: 10
Rob Crowther wrote: If you want a totally secure system then disconnect it from any network and run it off a read only filesystem, but you would be limited in what you could achieve with such a system.


Agreed. This I say to some people that want to have fully secure app - It's like with safe sex - to be absolutly sure it's safe - just don't do it). But I'm not sure that the people writing the specs and the people creating the browsers can help much here, it's like you said about HTML5 - it's allows, and you choose to use it or not. So the most of responsibility I think is on webmasters...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: HTML 5 File API