Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get the file size before Uploading the file?

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All

I want to check the file size before Uploading the file using Java Script that should be compatable with Mozilla and IE....
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 802
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic