• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Checking file size using client side scripting

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a web application which uploads a file to the server. Is it possible to check the file size before I upload it to the server? Are there any java script code available for this.
My application is written using JAVA/JSP and deployed using Tomcat 4.0
I tried using "Scripting.FileSystemObject", but gives me an error "Automation server cant create object" Any idea why this error occurs?
Thanx in Advance
Biju Nair
 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A better question might be "why do you want/need to check the file size before it's uploaded"? There are ways to deny (on the server-side) uploading files over a certain size. I assume that's what you are trying to do?
Brian
[ January 08, 2004: Message edited by: Brian Pipa ]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As a user I'd find it very irritating to wait ages while a multi-megabyte file uploads on a slow link, only to be told it's too big. It would be much more friendly to be told that before I have to wait for the upload
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not believe that there is anyway to do this on the client side (since client-side scripting has no access to the file system). But I'll move this on over to the HTML/Javascript forum in case anyone else has some bright suggestions.
bear
[ January 08, 2004: Message edited by: Bear Bibeault ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not do it with client side scripting with the best of my knowledge.
look at this though to see if this helps you out any(not positive that it will):
http://www.oop-reserch.com/mime_example_4.html
Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic