Detect uploaded files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jankie
    New Member
    • May 2007
    • 58

    Detect uploaded files

    Good morning everyone !

    I have a form with an upload section.Current ly the form submits user input as normal(direct into database).I want if they upload some file,the file is detected and then they are sent a confirmation email instead.If no file uploaded ,they get a thank you page(as it is now) .This is to at least have some control in the uploads,as am getting some garbage uploads,leaving an upload form sitting vulnerable like that.
    I hope if someone can share me the insight of how it can be done.
    My gratitude in advance !
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Originally posted by Jankie
    This is to at least have some control in the uploads,as am getting some garbage uploads,leaving an upload form sitting vulnerable like that.
    I hope if someone can share me the insight of how it can be done.
    You'll be wanting to analyze your $_FILES array.

    Comment

    • Jankie
      New Member
      • May 2007
      • 58

      #3
      Can you please elaborate on this a bit more ?

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        Originally posted by Jankie
        Can you please elaborate on this a bit more ?
        Sure. When you upload a file to a PHP script, PHP automatically stores information about the uploaded file in a superglobal array called $_FILES.

        For more information, take a look at this page:


        To take a look at your entire $_FILES array at a glance, simply include this code:

        [code=php]
        header('Content-type: text/plain');
        var_dump($_FILE S);
        exit;
        [/code]

        Comment

        • Jankie
          New Member
          • May 2007
          • 58

          #5
          Thank you very much !
          This will surely get me started
          off to implementation

          Comment

          Working...