Re: able to upload 28 meg file, yet php.ini limits posts to 10 megs. What is up with that?

Jerry Stuckle wrote:
You can't tell the "file type" until the file is uploaded. All you know is the file name - and a .jpg file does not necessarily have to be a .jpg file - it could be anything.

You also don't know the size before the file is uploaded - again, all you know is the size provided by the browser (if it is - it may not be).

And you can't check anything in your code before the file is uploaded anyway - your code doesn't get control until after the file is uploaded.

There are ways to control the size in HTML, but those can be ignored by the browser.

In short, you can't guarantee anything about the file until it has been uploaded.

Use Flash
an example to check file details before upload

Relevant Pages

  • ASP.NET suppress response HTML
    ... I have an ASP.NET webpage that allows a user to upload a file from the ... I'm posting the upload through an XMLHTTP ... control runs in parallel with the browser, ...
  • MIME types reported by browser during file upload
    ... I am trying to resolve an issue with a file upload control (written by ... uploaded by checking its MIME type. ... the browser reports the MIME type as ...
  • Re: Resizing images with PHP
    ... This assumes you've uploaded a JPG file already. ... > participants can upload their photos to the contest and contest ... > quality levels up to 95. ...
  • Re: Showing a loading screen
    ... in genreral this will be difficult to do without an active/x control. ... is treated by the browser as a page request. ... animation thread while posting. ... I have can upload a file to the server from my aspx page using the ...
  • Re: I was going to upload a photo to Flickr
    ... You do need to be able to find the .JPG file on your ... On your Flickr web page is the word ... lower right hand corner of that window after you have selected the file. ... Click on "Upload 1 Photo" and be patient while those bits fly back ...