Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Hidden fields and a partial HTML download

by dek (Initiate)
on Apr 11, 2003 at 13:16 UTC ( #249873=perlquestion: print w/ replies, xml ) Need Help??
dek has asked for the wisdom of the Perl Monks concerning the following question:

And behold: PerlMagick, Apache, Hidden fields and a partial HTML download – what’s causing this error?

Hi everyone, here’s hoping someone has seen this problem before…

I’m developing an image library for an intranet using SuSE 8. Users can add images via an upload on a web page which talks to my ‘initialising script’. It simply prepares the image for storage by checking with a MySQL DB to see if the image name is in use, if not it asks image magick (Image::Magick) to create a thumbnail and get image information (size, colours etc) It puts the Thumbnail and the uploaded file into a temp directory and returns a page to the user for their confirmation before adding to the database and copying the image and thumb to it’s correct storage location – really sorry if this is long winded …

Within the html page the script returns are about 10 hidden fields with the data ready to go to the ‘add to db’ script should the user want to continue.

My problem is, these hidden fields are somehow stopping the confirmation page from downloading completely. It usually stops somewhere between the first and last of the fields. I’ve testing using a variety of images too – and SOMETIMES it works fine even though the image is same type and size as another that failed!

The fields don’t contain much data either and I’ve checked for odd characters and so on. I tried just outputting the variables with a plain header and they work fine – when I add a form with hidden fields I get a server error with no feedback (even with –w and carp!) – Searches on the net and at SuSE have turned up nothing! I’m now thinking about a trip to the PC Warehouse for a copy of Red Hat.

Any help would be great.

Ps – what a great website this is!

Comment on Hidden fields and a partial HTML download
Re: Hidden fields and a partial HTML download
by hiseldl (Priest) on Apr 11, 2003 at 13:30 UTC

    Have you tried using just a session ID with all the fields stored locally? Use the session ID as the key to find all the values, e.g. session ID is a column name in a database, or session ID is key of a tied hash. CGI::Session has a cookbook and a nice tutorial if you want to try it.

    Also, why don't you use the "height" and "width" attributes in the <img> tag to create your thumbnail images? For example, the original image is 400x600, you could put a thumbnail using just the attributes, i.e. <img height="40" width="60" src="img.gif">. Unless you are doing other transformations with Magick, this may work a little faster for you.

    --
    hiseldl
    What time is it? It's Camel Time!

      Also, why don't you use the "height" and "width" attributes in the <img> tag to create your thumbnail images? For example, the original image is 400x600, you could put a thumbnail using just the attributes, i.e. <img height="40" width="60" src="img.gif">.

      ARRRGGGHHHH. The world would be a better place if people would STOP DOING THIS. The point of a thumbnail is to give you a preview of the image before you download the whole thing. By doing your thumbnails in this manner, you force the browser to download the entire 400x600 image, and then display it as a tiny representation of itself. You didn't save anything, you might as well have just shown it full size. It may work great for you when you view the page from your hard drive while you develop it, but it's a huge waste of time and bandwidth to do this over the net.


      We're not surrounded, we're in a target-rich environment!

      That's a great answer! Thanks. I'll add that to my tips and techniques page. :-)

      dek did say it is on an intranet, so I didn't think that the bandwidth issues would be so great.

      --
      hiseldl
      What time is it? It's Camel Time!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://249873]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-09-01 13:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (11 votes), past polls