SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
-
Oct 20, 2003, 05:32 #1
- Join Date
- Apr 2003
- Location
- UK
- Posts
- 152
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
is file upload size validation possible
Hello everyone.
Is it possible to check for file upload size using Javascript?
I know how to do it using PHP, but I'd like to use Javascript as an additional validation process to ease on server load.
Any help/pointers would be greatly appreciated.
Thanks
Matt
-
Oct 20, 2003, 07:47 #2
- Join Date
- Jul 2003
- Location
- Moncton, New Brunswick, Canada
- Posts
- 247
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Can't be done with javascript. Security features built in to the language stops any file read or writing on a client's machine. When you click the browse button in an html file input, it only grabs the path string to the file in question. Anything you wish to do after that can only be accomplished with a server-side solution.
-xDev
-
Oct 20, 2003, 09:19 #3
- Join Date
- Apr 2003
- Location
- UK
- Posts
- 152
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok .. thanks for your reply
-
Oct 20, 2003, 15:03 #4
- Join Date
- Jul 2002
- Location
- Dallas, TX
- Posts
- 2,900
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
xDev, not 100% true, as ActiveX allows for file reading/writing, but it's a security issue and should not be done. It's also IE/Win only.
So, from a theory standpoint, it's possible, but from an application standpoint, I agree with you -- it should not be considered.
-
Oct 20, 2003, 15:19 #5
- Join Date
- Jul 2003
- Location
- Moncton, New Brunswick, Canada
- Posts
- 247
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by beetle
Your right as usual
I was thinking the same thing when I posted but decided not to even point it out. And as you mentioned, ActiveX (and JScript) aren't very practical for this situation.
-xDev
Bookmarks