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;
}
}
|