Ask questions via twitter! Message any question to @answers on twitter. We'll publish the question and send you a reply each time there's a new answer.
Next Question

Answered Question

 
 M¢37  Funded By Mahalo ? |  September 17, 2009 05:14 AM

Using Javascript, Can I get the file size on the client side?

How can I create a file on the client side?
Interesting Question?  Yes (0)   No (0)   
RSS
 
 

Best Answer  Decided by Votes

 
September 18, 2009 05:28 AM
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.
following urls
*************
1 Answers for "Using Javascript, Can I get the file size on the client side? " Sort by: Most Recent Top Rated. Prev1NextShowing 1 - 1 of 1 ...
toostep.com/.../using-javascript-can-i-get-file-size-on-client-side - Cached - Similar
Using Javascript, Can I get the file size on the client side?17 Sep 2009 ...

Code Style: Javascript frequently asked questions (FAQ)Q: Can I get the file size on the client side? A: It is not possible to access files on a person's computer using Javascript through a Web browser, ...
www.codestyle.org/javascript/FAQ.shtml - Cached - Similar


Helpful Answer?  (0)   (0)    Tip rajivjackz for this answer
Permalink | Report
   Reply  
 
 

Other Answers (1)

Sort By
 
September 17, 2009 09:00 AM
It is not possible to access client side file property using Java Script.It will be serious security issue if Javascript code on web page can read client side files, be'cos same can be sent to server via Java Script. For this reason only, JavaScript does not allow client side file reading facility.
Source(s):
http://toostep.com/question/


Tags: nhs4you, mahalo, javascript, internet

Helpful Answer?  (0)   (0)    Tip nhs4you for this answer
Permalink | Report
   Reply  
 
 

Answer this Question

How tips and payments work

This question has already been resolved. You may add an answer to it but you will not be eligible to win best answer or any associated tips.

Ask a Question


140 characters left
Top of Page
Buy Mahalo Dollars with Credit Card or PayPal

Top Members

This Week All Time
  • buddawiggi
    buddawiggi
    2nd Degree Black Belt
    27543 Points
    M$789.91 Earned
  • opher
    opher
    Purple Belt
    4443 Points
    M$196.22 Earned
  • annelisle
    annelisle
    Purple Belt
    2997 Points
    M$91.22 Earned
   See All
 

Most Popular Tags

mahalo(1618)
iphone(465)
music(460)
google(357)
food(321)
online(295)
beer(279)
money(262)
movies(255)
apple(251)
aotd(235)
health(219)
video(207)
free(205)
dog(205)
   See All
 

Categories

Welcome New Members


 
 
Mahalo Dollars are the currency of Mahalo Answers.

Each Mahalo Dollar costs $1.

Once you earn more than 40 Mahalo Dollars, you can request to be paid via PayPal. Each Mahalo Dollar is currently worth $0.75 when paid out via PayPal. Learn More

 
 

Please log in to use this function.