Thread: Javascript Help
View Single Post
Old 01-12-2006, 11:29 AM   #1 (permalink)
Nutty_ZA
Moderator
My Mood:
Points: 9,884, Level: 66 Points: 9,884, Level: 66 Points: 9,884, Level: 66
Level up: 59% Level up: 59% Level up: 59%
Activity: 100% Activity: 100% Activity: 100%
 
Nutty_ZA's Avatar
 
The Haggis Hurl Champion!
Carrot Sweeper Champion!

Join Date: May 2004
Location: Sandton, South Africa
Posts: 1,694
Credits: 10,470
Nominated 9 Times in 2 Posts
Nominated TOTW/F/M Award(s): 2
Nutty_ZA is on a distinguished roadNutty_ZA is on a distinguished roadNutty_ZA is on a distinguished roadNutty_ZA is on a distinguished roadNutty_ZA is on a distinguished roadNutty_ZA is on a distinguished road
Send a message via Skype™ to Nutty_ZA
Default Javascript Help

Hope someone here can help me...
I am in the process of developing a website for somebody....
One of the requirements is that Photo's can be uploaded to the server...
I want to restrict users to 100 K image sizes... I have written A javascript function that utilises the windows File System Object (see below)... this works but obviously this has a number of problems... Firstly most Internet browsers will in general block this script unless activex downloads are enabled in the browser, secondly, unless the user is running windows, this wont work either... what is the best way to do this????
Ta,

Clive.

function check_file()
{
var path=document.form.photo.value;
var fso = new ActiveXObject("Scripting.FileSystemObject");
fileObj = fso.GetFile(path);
if(fileObj.size>'100')
{
alert ("File is too big (Max 100kb). Please reduce image size before uploading");
return 0;
}
}

To err is human. To ARRR is pirate.
View Nutty_ZA's Photo Album   Reply With Quote