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, 1809 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 Recruitment Firm
  • Create a confidential Career Profile and Resume/C.V. online
  • Get advice for planning their career and for marketing of experience and skills
  • Maximize awareness of and access to the best career opportunities
Viewers also viewed
Yes vs No
 
0 referals 29 arguments, 619 views
Corporations are finding it tough to settle on a single development architecture such as .Net or...
 
3 referals 79 arguments, 2625 views
Which one is more better secure ?
 
1 referals 17 arguments, 1311 views
more...  
Unanswered Questions (243)
  HI all, I am presently conducting an online survey for IT/Software professionals in India as a...
 
0 referals 0 answers, 0 views
HI all, I am presently conducting an online survey for IT/Software professionals in India as a...
 
0 referals 0 answers, 0 views
HI all,   I am presently conducting an online survey for IT/Software professionals in India as a...
 
0 referals 0 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...