Solved

How to identify Size of a PDF file in JavaScript?

Posted on 2009-04-01
3
341 Views
Last Modified: 2012-05-06
Hi All,
In our ASP.NET, Ajax Based application, I have a requirement of uploading pdf files, and the need is to restrict the files to a specific file size.
It is possible to check the file with a ActiveX - FSO, which needs changes to Security settings of IE.

Is there a way to identify the size of the PDF files at the client side (Javascript) without using ActiveX objects?

Thanks in advance.
-Vidhee    
0
Comment
Question by:vidhee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Morcalavin
ID: 24038262
Without using active-x, there is no way to identify the size of a file using javascript.
0
 

Author Comment

by:vidhee
ID: 24104071
thanks a lot for the reply.
Out of curious, i have a question.
There are so many upload tools available in the market which does evaluate the file size before upload. One of the example is the ComponentArt Upload tool.
Does that mean that there are some alternatives to evaluate the file information at the client side?
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 250 total points
ID: 24704416
It is possible to check for filesize using things like Java applets, since they run client size, but have more access to the filesystem, provided they are signed and the user allows them to be installed.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…
Suggested Courses

622 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