Jump to content

Recommended Posts

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
Link to comment
https://forums.phpfreaks.com/topic/9181-upload-script-file-size-limit/
Share on other sites

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..
  • 4 weeks later...
You can't change upload_max_size on runtime, but you can check the size of an uploaded file. Something like this:

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

1024 bytes = 1 KB
1024 KB = 1 MB
1024 MB = 1 GB
...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.