Build your professional network on facebook via our app Go to app
 
 
Posted in Community :

Lightweight JavaScript

 
Industry : IT Services
Functional Area : Application Software
Activity: Question posted: 05 13 2008 00:09:38 +0000, 1 answers, 2208 views, last activity 07 06 2010 20:18:08 +0000
 
Share
 
 
  Rate : 
 
 
  Answered by     Dipen Trivedi, Project Manager, 3i Infotech  | 05 13 2008 00:10:14 +0000
[ Delete ]
[ Edit ]
Not Rated

It is not possible to access files on a person's computer using Javascript through a Web browser, or to read the properties of files. It would be a serious security and privacy hazard if Javascript code in a Web page could read files on your computer because the information could be sent back to the site via a form or other mechanisms. For these reasons the possibility of file access was excluded when the Javascript language was designed.

Other client side solutions such as ActiveX and Java applets require special security consent from the user, which many people are reluctant to grant, and only make the job more complicated and risky from their point of view. Not all Web browsers are configured to support ActiveX or Java.

The only effective way to check the size of a file for upload is on the server side. Your server side form handler must process the file and this is the best place to apply a limit to the number of bytes you will accept.

Q: How can I create a file on the client side?

A: It is not possible to create files on the client's computer using Javascript. This type of action is excluded from the Javascript language because it would be a serious security hazard. The only form of local file storage available through Javascript is cookies, whose behaviour and contents are strictly prescribed.

Of course it is possible to use Javascript to generate file content in a Web browser window and invite people to save the contents. Internet Explorer and Firefox users can use the File menu Save as... option directly, but Opera and other browser users may have to copy the text into another application to save it.

 
Leading executive search firm
Java EE, JBoss, Hibernate, Spring, Eclipse, EA, Webservices, Senior Java Developer, IT Product Development & Services Company with Focus on online gaming Space, Hyderabad
Servelets, JSP, REST/JCR, AJAX, Iquery, JavaScript,HTML, Java J2SE, Linux, Portal Develper- Architect, IT Product Development & Services Company with Focus on online gaming Space, Hyderabad
Servelets, JSP, REST/JCR, AJAX, Iquery, JavaScript,HTML, Java J2SE, Linux, Portal Developer, IT Product Development & Services Company with Focus on online gaming Space, Hyderabad
Viewers also viewed
Mallick Software Solutions provides end-to-end web design and development solutions that enhance...
 
18 referals 3 arguments, 351 views
Though media vs Self
 
157 referals 105 arguments, 3005 views
Dynamic Management Views   The dynamic management views (DMV’s) in SQL Server 2005 are designed...
 
11 referals 6 comments, 1828 views
more...  
Unanswered Questions (68)
I mean that it sector totally depends on outsourcing.But it might happen that in future other...
 
0 referals 0 answers, 0 views
Hi,  I need some information ..  How can you understand and control costs? and  Is there an...
 
1 referals 1 answers, 31 views
Hi  frnds...          I am a fresher.now i got placed in software company.But i didn't sign in...
 
0 referals 1 answers, 0 views
More From Author
Really this is just using solar as a heat source - mass produced nuclear power is a much cheaper heat source so for a large scale operation. As a small scale unit in remote and off the grid places, it'd be a great source of fuel. The most important...
Only a life lived for others is a life worthwhile - Albert einstein Life it is as simple as that........
Kavitha here is an update for 3G: 3G services was announced in India a month ago but we shall see more delays in the launch, as 3G vendors still haven’t placed orders for equipments. “Bharti and Vodafone have calculated their infrastructure requirement...
more...