Uploading files with enctype="multipart/form-data"

Results 1 to 2 of 2

Thread: Uploading files with enctype="multipart/form-data"

  1. #1
    Join Date
    Dec 1969

    Default Uploading files with enctype="multipart/form-data"

    When you do this, does it somehow make the file unrecognizeable? I am trying to use the solution found:<BR><BR>http://www.4guysfromrolla.com/webtech/050300-1.shtml<BR><BR>but it is not working. All the files I have to resize are .jpg, and were uploaded to the server through a form. The article says, "The routine returns FALSE if the file was not recognized as a valid image type, and TRUE if it is &#039;probably&#039; a valid image file." Well, I am not getting TRUE, but I can open these files with no problem. Just wondering if this is the problem and if so, what can I do about it.<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default If the file...

    ...by itself, shows up just fine in the browser, then the problem is in the code that tries to analyze the file.<BR><BR>The article was written over 3 years ago, and maybe the JPEG encoders are getting better and/or just a bit different from what that program is expecting.<BR><BR>Anyway, that code won&#039;t help you resize the image files. You will *still* have to send the entire image (however big it might be) down to the user&#039;s browser. And you can much more easily do the resizing in the browser.<BR><BR>The *right* answer is to buy a graphics component (or there are a couple of freebies) that will actually change the image size and allow you to write it out to a new (or the same) file. Then you could easily change your 1600x1200 JPGs to 400x300 and go from 1MB to about 40KB download size (which is what I do for our site). Without a server-side component, all 1MB has to be downloaded, no matter what size you show it as in the browser.<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts