preview problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin S

    preview problem

    I have a form that sends data on to another page so that the user can
    preview it before it is inserted in a database table.

    The problem is that the form sends both text and possibly an image to
    the page used for preview. Even if I use a hidden input field for the
    image file it still is displayed on the text centric page but with
    enctype for foo bars the image into gibberish that fills a large part of
    the preview page.

    How can I pass the image on to the preview page without it being
    "displayed" ? (Image is validated later).


    /M.
  • Jan Pieter Kunst

    #2
    Re: preview problem

    In article <6rKfc.56258$mU 6.232645@newsb. telia.net>,
    Martin S <martin@skjolde brand.org> wrote:
    [color=blue]
    > I have a form that sends data on to another page so that the user can
    > preview it before it is inserted in a database table.
    >
    > The problem is that the form sends both text and possibly an image to
    > the page used for preview. Even if I use a hidden input field for the
    > image file it still is displayed on the text centric page but with
    > enctype for foo bars the image into gibberish that fills a large part of
    > the preview page.
    >
    > How can I pass the image on to the preview page without it being
    > "displayed" ? (Image is validated later).
    >
    >
    > /M.[/color]

    Store it in a temp directory on the server, and pass on a reference to
    the image in a hidden variable to the preview page?

    Just the first thing that comes to mind.

    JP

    --
    Sorry, <devnull@cauce. org> is een "spam trap".
    E-mail adres is <jpk"at"akamail .com>, waarbij "at" = @.

    Comment

    • FLEB

      #3
      Re: preview problem

      Regarding this well-known quote, often attributed to Martin S's famous
      "Fri, 16 Apr 2004 05:46:42 GMT" speech:
      [color=blue]
      > I have a form that sends data on to another page so that the user can
      > preview it before it is inserted in a database table.
      >
      > The problem is that the form sends both text and possibly an image to
      > the page used for preview. Even if I use a hidden input field for the
      > image file it still is displayed on the text centric page but with
      > enctype for foo bars the image into gibberish that fills a large part of
      > the preview page.
      >
      > How can I pass the image on to the preview page without it being
      > "displayed" ? (Image is validated later).
      >
      >
      > /M.[/color]

      You can't put an image inline into HTML code. You have to save it somewhere
      on the server, and make an <IMG SRC=""> tag, and possibly a hidden value or
      session variable so the app knows where to find the image if the submission
      is acceptable.

      Remember: Never trust the user. Make sure that image is an image file
      before you display it. You don't want your site "displaying " a .php file
      they uploaded as an image.

      --
      -- Rudy Fleminger
      -- sp@mmers.and.ev il.ones.will.bo w-down-to.us
      (put "Hey!" in the Subject line for priority processing!)
      -- http://www.pixelsaredead.com

      Comment

      • Tim Van Wassenhove

        #4
        Re: preview problem

        In article <1erkvpwgqikp4. i5t29h1k36r1.dl g@40tude.net>, FLEB wrote:[color=blue]
        > Remember: Never trust the user. Make sure that image is an image file
        > before you display it. You don't want your site "displaying " a .php file
        > they uploaded as an image.[/color]

        Remember that only looking at the extension of a file is not a good idea
        either.

        --

        Comment

        Working...