[PHP] Detect file size BEFORE upload it

2005-10-06 Thread Ruben
Hi, I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread Jasper Bryant-Greene
Ruben wrote: I have been trying _several_ ways to control the size of the files that can be uploaded in a form. The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread Richard Davey
Hi Ruben, Thursday, October 6, 2005, 7:38:35 AM, you wrote: The problem is that I was able to detect file size after complete file is transfered. I need to detect file size before all file is transfered, in order to cancel it and preserve server resources. Any ideas? The only way to do

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread Ruben Rubio Rey
:) U have it. Its perferct. Im gonna check it, but seems to be the solution. Raditha Dissanayake wrote: While you are at SF checkout Mega Upload. Ruben Rubio Rey wrote: Anyway, if I would use any applet I ll use one of sourceforge.net. Its free and I can modify source, so I can

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread tg-php
I know that part of the POST transaction with the client and web server involves sending the 'content-length'.. there's no way to tap into that before the file's uploaded though I guess. (example of how to manually POST using Python at leastfound here:

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread Jasper Bryant-Greene
[EMAIL PROTECTED] wrote: var myFile = new File(c:\temp\myfile.txt); myFile.open(r); alert('myFile length: ' + myFile.getLength()); Somehow I don't think any browser is going to give JS access to arbitrary files on the user's system like that. -- Jasper Bryant-Greene Freelance web developer

Re: [PHP] Detect file size BEFORE upload it

2005-10-06 Thread tg-php
Yeah, you're right. I didn't test that before I posted it. Looks like you can do it as long as your clients are running Windows and you can use Active X or another Windows trick using something like JScript, but with pure Javascript it looks bleak. I tried to use something like this: img =