Jump to content
Sign in to follow this  

_FILES array

Recommended Posts

I'm unable to submit questions to the Godaddy forum and no one is answering the phone "to exceed my expectation" ... any help appreciated.

trying to send an email with image file attachment ...my html form

<form method="post" action=".\sendContact.php" enctype="multipart/form-data">

<input type="TEXT" name="email">

<input type="file" name="file">

<input type="submit" value="Submit">

in sendContact.php I have

echo $_POST['email'];

echo $_FILES['file'];

which echo's the email address text ok but for file I just get "Array" (presumably empty)?

I have uploaded php.ini from https://gist.github.com/TheSunMan/4008090 with upload_max_filesize = 2M and max_file_uploads = 20

Share this post

Link to post
Share on other sites

Two things:


  • Set your form action to sendContact.php
  • As you've named your input "file" you'll need to reference that key within the files array i.e. $_FILES['file']

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing

    No registered users viewing this page.

  • Member Statistics

    • Total Members
    • Most Online

    Newest Member
  • Forum Statistics

    • Total Topics
    • Total Posts