questions about uploading file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • detrox@gmail.com

    questions about uploading file

    Hi, all

    I have two questions about uploading files using php & html:
    1. How can i add a `file type' in the pop window when i click
    `browse' button of the `<input type=file>'.
    2. How can i get the local path of the uploading file. btw, i know
    there's a $_FILE['userfile']['name'], but it only give me the name not
    the path.

    thx very much~~.

    ^_^ detrox

  • petersprc

    #2
    Re: questions about uploading file

    You can use mime_content_ty pe to determine the type of the file by its
    name.

    detrox@gmail.co m wrote:
    Hi, all
    >
    I have two questions about uploading files using php & html:
    1. How can i add a `file type' in the pop window when i click
    `browse' button of the `<input type=file>'.
    2. How can i get the local path of the uploading file. btw, i know
    there's a $_FILE['userfile']['name'], but it only give me the name not
    the path.
    >
    thx very much~~.
    >
    ^_^ detrox

    Comment

    • hackajar@gmail.com

      #3
      Re: questions about uploading file

      On question #2:

      do a "print_r($_FILE );" in your script. This may give you the answer
      your looking for ;)

      -hackajar
      detrox@gmail.co m wrote:
      Hi, all
      >
      I have two questions about uploading files using php & html:
      1. How can i add a `file type' in the pop window when i click
      `browse' button of the `<input type=file>'.
      2. How can i get the local path of the uploading file. btw, i know
      there's a $_FILE['userfile']['name'], but it only give me the name not
      the path.
      >
      thx very much~~.
      >
      ^_^ detrox

      Comment

      • Jerry Stuckle

        #4
        Re: questions about uploading file

        detrox@gmail.co m wrote:
        Hi, all
        >
        I have two questions about uploading files using php & html:
        1. How can i add a `file type' in the pop window when i click
        `browse' button of the `<input type=file>'.
        2. How can i get the local path of the uploading file. btw, i know
        there's a $_FILE['userfile']['name'], but it only give me the name not
        the path.
        >
        thx very much~~.
        >
        ^_^ detrox
        >
        Peter already answered your first question. As for the second one - you
        can't. Such would be a huge security gap by exposing the user's file
        structure.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        Working...