473,320 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

limiting upload file size

>From my various readings I figured that there is no reliable way to
check file size before upload begins via a POST method. Browser side
checking can be fooled.

I also figured that file size is checked only after the upload
finishes.

This can be dangerous since a large file upload can take server disk
space down.
(atleast for a while - until the php script detects it and deletes the
file)

The server *MUST* stop receiving a file immediately, if file size grows
beyond a specified size.

How is this achieved ?

Mike

Sep 3 '05 #1
3 1564
Hi Mike,

there is a php-setting called "upload_max_filesize". you can set it via
editing php.ini or the ini_set()-function in your script.

it is also possible to use the browser to control max-uploaded size:
<input type="hidden" name="MAX_FILE_SIZE" value="30000">

please read php.net: http://www.php.net/manual/en/features.file-upload.php

Greets,
Philipp
Sep 3 '05 #2
I read that already, but it didn't exactly specify whether the server
stops receiving the file *immediately* upon reaching the max limit.

(or did I miss something?)

Mike

Philipp Heckel wrote:
Hi Mike,

there is a php-setting called "upload_max_filesize". you can set it via
editing php.ini or the ini_set()-function in your script.

it is also possible to use the browser to control max-uploaded size:
<input type="hidden" name="MAX_FILE_SIZE" value="30000">

please read php.net: http://www.php.net/manual/en/features.file-upload.php

Greets,
Philipp


Sep 3 '05 #3
On 3 Sep 2005 03:07:40 -0700, "siliconmike" <si*********@yahoo.com> wrote:
The server *MUST* stop receiving a file immediately, if file size grows
beyond a specified size.

How is this achieved ?


http://httpd.apache.org/docs/2.0/mod...mitrequestbody

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 3 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
4
by: Johnson | last post by:
I understand that setting maxRequestLength in Web.config will allow me to limit the size of file users upload to an ASP.NET Web site. Questions: 1. What happens when the user attempts to upload...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
0
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
1
by: Marko Vuksanovic | last post by:
I used the following code for implementing a file upload progress indicator, using UpdateProgress Panel, though I have a problem that FileUpload.Has File always returns false. Any suggestions what...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
2
by: Mufasa | last post by:
I am using the file upload control and want to limit the size of the file that is uploaded. But it appears as if it actually uploads the file and then does the check. Is that true? Ideally I'd...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.