Strange behavior passing file from form...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jeff Homan

    Strange behavior passing file from form...

    Hello,

    I don't know where to begin with this as it's kind of a strange error
    and I can't figure it out. I've got a form that I pass several
    variables to a php page. One of the variables is a file that is
    getting uploaded.

    The INPUT is type "file" and the form enctype is set to
    "multipart/form-data"

    But what happens, is when it gets to the php page that these vars are
    sent too, is the file only shows as a forward slash "/" - This is
    really bugging me because all of the other variables get passed with
    no problems, so I'm at a loss.

    Does anyone have any ideas with the problem that I'm having? I'm using
    php 4.2.2 on Apache 2.0.40 and I'm not sure what other info would help
    with this.

    Thank you in advance for any ideas,
    Jeff
  • Daedalus

    #2
    Re: Strange behavior passing file from form...

    File information is in $_FILES['NameOfTheInput FileTag']

    it's an array. To see what it holds, use:

    print_r($_FILES['NameOfTheInput FileTag']);

    If it's not the problem, share some code so someone can take look at it.
    ..
    Dae

    [color=blue]
    > I don't know where to begin with this as it's kind of a strange error
    > and I can't figure it out. I've got a form that I pass several
    > variables to a php page. One of the variables is a file that is
    > getting uploaded.
    >
    > The INPUT is type "file" and the form enctype is set to
    > "multipart/form-data"
    >
    > But what happens, is when it gets to the php page that these vars are
    > sent too, is the file only shows as a forward slash "/" - This is
    > really bugging me because all of the other variables get passed with
    > no problems, so I'm at a loss.
    >
    > Does anyone have any ideas with the problem that I'm having? I'm using
    > php 4.2.2 on Apache 2.0.40 and I'm not sure what other info would help
    > with this.[/color]


    Comment

    • Jeff Homan

      #3
      Re: Strange behavior passing file from form...

      OK,

      Here is the form input statement:

      <input type="file" name="product_t humb_image" size="32"
      maxlength="255" />

      Then the next page it goes to, the first thing I call is this:

      $d["error"] = "Filename: " . $d["product_thumb_ image_name"];

      This then outputs "Filename: /"

      But if I put:

      $d["error"] = "Test price: " . $d["price"];

      it outputs: "Test price: 32.99"

      So what I don't understand is why I'm only getting a forward slash "/"
      as the filename. That seems really odd.

      Does this help at all, or do you need more info?

      Jeff









      On Mon, 25 Oct 2004 04:09:13 GMT, "Daedalus" <daedalus_ca@ho tmail.com>
      wrote:
      [color=blue]
      >File information is in $_FILES['NameOfTheInput FileTag']
      >
      >it's an array. To see what it holds, use:
      >
      >print_r($_FILE S['NameOfTheInput FileTag']);
      >
      >If it's not the problem, share some code so someone can take look at it.
      >.
      >Dae
      >
      >[color=green]
      >> I don't know where to begin with this as it's kind of a strange error
      >> and I can't figure it out. I've got a form that I pass several
      >> variables to a php page. One of the variables is a file that is
      >> getting uploaded.
      >>
      >> The INPUT is type "file" and the form enctype is set to
      >> "multipart/form-data"
      >>
      >> But what happens, is when it gets to the php page that these vars are
      >> sent too, is the file only shows as a forward slash "/" - This is
      >> really bugging me because all of the other variables get passed with
      >> no problems, so I'm at a loss.
      >>
      >> Does anyone have any ideas with the problem that I'm having? I'm using
      >> php 4.2.2 on Apache 2.0.40 and I'm not sure what other info would help
      >> with this.[/color]
      >[/color]

      Comment

      Working...