Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Browse Button

New Here ,
Aug 11, 2009 Aug 11, 2009

Copy link to clipboard

Copied

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.

TOPICS
Server side applications

Views

511
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 11, 2009 Aug 11, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 11, 2009 Aug 11, 2009

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines