is there a way of checking the size of the file before an upload begins

M

Mel

how can i restrict file uploads above certain size ?

is there a way of checking the size of the file before an upload begins ?

thanks for help
 
B

brucie

In alt.html Mel said:
how can i restrict file uploads above certain size ?

yes. the giggly php manual has a good section on file uploading
http://php.net/features.file-upload

if php isn't you giggly language just translate what it says into your
language or check your languages manual.

excellent forms reference:
http://www.cs.tut.fi/~jkorpela/forms/index.html
is there a way of checking the size of the file before an upload begins?

yes, see the above. just never forget where it mentions on the form the
max file size evil people can change it and make you cry.
thanks for help

kissy
 
E

Erich Musick

I did a quick google search and found this code. I think it will only
work on windows, in Internet Explorer

<html>
<head>
<script language="JavaScript">
function A()
{
var oas = new ActiveXObject("Scripting.FileSystemObject");
var d = document.a.b.value;
var e = oas.getFile(d);
var f = e.size;
alert(f + " bytes");
}
</script>
</head>
<body>
<form name="a">
<input type="file" name="b">
<input type="button" name="c" value="SIZE" onClick="A();">
</form>
</body>
</html>


how can i restrict file uploads above certain size ?

is there a way of checking the size of the file before an upload begins ?

thanks for help

--
In Christ,

Erich Musick
http://erichmusick.com

In the same way, let your light shine before others, so that they may
see your good works and give glory to your Father who is in heaven. --
Matthew 5:16 NKJV
 
S

Sybren Stuvel

Erich Musick enlightened us with:
I did a quick google search and found this code. I think it will
only work on windows, in Internet Explorer

In other words: useless.

Sybren
 
J

Jan Faerber

brucie said:
In alt.html Mel said:


yes. the giggly php manual has a good section on file uploading
http://php.net/features.file-upload

if php isn't you giggly language just translate what it says into your
language or check your languages manual.

excellent forms reference:
http://www.cs.tut.fi/~jkorpela/forms/index.html

There are many links here -

one gets you there:
http://www.htmlhelp.com/faq/html/forms.html#file-upload
.... but no word about restriction here.

another one:
http://www.cs.tut.fi/~jkorpela/forms/file.html#restr
<quote>
The server-side form handler can be coded to do whatever the programmer
wants, and imposing some upper limit is clearly a must. (That is, the code
should check for the input size, and discard, or otherwise process in a
special way, submissions exceeding a reasonable limit.)
</quote>
.... but how?

And I wouldn't restrict 'restriction' to forms.
What about ftp upload?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top