Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > is there a way of checking the size of the file before an upload begins

Reply
Thread Tools

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

 
 
Mel
Guest
Posts: n/a
 
      11-17-2004
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


 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      11-17-2004
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

--
the facts and opinions expressed by brucies
l i t t l e v o i c e s
are not necessarily the same as those held by brucie.
 
Reply With Quote
 
 
 
 
Erich Musick
Guest
Posts: n/a
 
      11-17-2004
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>



Mel wrote:
> 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
 
Reply With Quote
 
Sybren Stuvel
Guest
Posts: n/a
 
      11-17-2004
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
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
 
Reply With Quote
 
Jan Faerber
Guest
Posts: n/a
 
      11-23-2004
brucie wrote:

> 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


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?




--
Jan

http://html.janfaerber.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check for where a text file begins? Al Cholic Ruby 2 07-03-2007 02:33 PM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
Upload a file without file Upload control - ASP.Net =?Utf-8?B?U2FyYXY=?= ASP .Net 3 08-03-2005 01:09 AM
is there a hardware / driver combination out there the lets win2k connect to the network before login?? christiane kewitz Wireless Networking 1 02-13-2005 01:08 AM
Checking file upload size Vicky ASP .Net 1 02-11-2004 09:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57