wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes How to get the file size before Uploading the file? 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 "How to get the file size before Uploading the file?" Watch "How to get the file size before Uploading the file?" New topic
Author

How to get the file size before Uploading the file?

santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Dear All

I want to check the file size before Uploading the file using Java Script that should be compatable with Mozilla and IE....


Creativity is nothing but Breaking Rules
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Sorry to say that JavaScript does not have this built in.

You wold have to use applets and/or activeX to do it.

Eric
Justin Fox
Ranch Hand

Joined: Jan 24, 2006
Posts: 802
if you are uploading, then you are using server sided code, becaue i dont think you can use ajax to upload a file.
so in what ever server language you're using, get the file via $_POST or whatever and check the file size there... you can also set a maximum file size on forms too.

Justin


You down with OOP? Yeah you know me!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the file size before Uploading the file?
 
Similar Threads
Image resizing as per desired size through JSP page
Check file size with Javascript before uploading
file size before upload with Jakarta commons FileUpload
Interrupting big file uploads to save traffic
about uploading