Jump to content


Photo

Upload script file size limit


  • Please log in to reply
5 replies to this topic

#1 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 06 May 2006 - 10:56 AM

I have made a little file upload script for images and was wondering if apache imposes some sort of upload size limit? It seems to be about 1.5mb. The script is for a client to add new pictures to the website, but I'm using GD to resize them, and so I would ideally like to be able to upload 5mb images (from digital camera).

Thanks for any help,
Stephen

#2 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 06 May 2006 - 01:05 PM

Generally the default upload file size is 2mb. This can sometimes be changed in your php.ini file (if your host allows it).

try running the phpinfo() on your host. then look for upload_max_filesize

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#3 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 06 May 2006 - 04:27 PM

ah ha!

Thanks very much for that. Im now using .htaccess to force it up to 5M.

Cheers
Stephen

#4 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 06 May 2006 - 05:26 PM

mine allowes 50mb

but when using uploa dform i know you gotta put a hidden field and give it a maxfile size allowed, but how do i know how muhc is 1mb if you have to give the file size in k. is there any where i can go that i cna calculate how many k or mb or what = whattever.. so when i want to give one specifict size i know what i'm doing..

#5 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 04 June 2006 - 11:46 AM

Use google, search for:
5mb in kb
or similar.


Stephen

#6 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 04 June 2006 - 03:10 PM

You can't change upload_max_size on runtime, but you can check the size of an uploaded file. Something like this:

if ($_FILES['file']['size'] >(1024 * 1024)) {
   echo 'File bigger than 1 MB!';
}

1024 bytes = 1 KB
1024 KB = 1 MB
1024 MB = 1 GB
...
~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users