Skip to main content
Participant
August 11, 2009
Question

Browse Button

  • August 11, 2009
  • 2 replies
  • 540 views

I am creating a insert page in PHP and need to create a browse for file button so I can upload files to my database.  I can't find a solution.  I have searched and there is nothing I see.  It can just be a path to the file on the server if it needs to be.  Thanks any help would be greatly appreciated.

This topic has been closed for replies.

2 replies

Participating Frequently
August 11, 2009

You don't create the button, you just create a input with the type = file

<input type="file" name="datafile" size="40">

Also remember you must setthe enctype to

enctype="multipart/form-data" method="post">

And obviously, adding the file input field doesn't do anything without the proper script to handle the uploaded file.

DwFAQ
Participating Frequently
August 11, 2009

Create a file browse button on a form by adding <input type="file"> and make the form enctype  enctype="multipart/form-data"