Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8798171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:01:20+00:00 2026-06-14T00:01:20+00:00

I am trying to use a basic upload form to place an image onto

  • 0

I am trying to use a basic upload form to place an image onto my server, and would like the code to post the new image url on the page after the upload. I am aware this is a vague question, but I have done a good amount of searching with no usable results. If anyone could help me with this or just give a point in the right direction it would be much appreciated.

<form action="upload.php" method="post" enctype="multipart/form-data">
<p>
<label for="file">Select a file:</label> <input type="file" name="userfile" id="file"> <br />
<button>Upload File</button>
<p>
</form>

is all that I have so far I know it is not much to start with I do not know how to handle the data that is sent to ‘upload.php’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:01:21+00:00Added an answer on June 14, 2026 at 12:01 am

    Look Here. Similar to how you use the $_POST array, you can use the $_FILES array to retrieve files that were submitted by a form.

    The $_FILES array will contain $_FILES["file"]["tmp_name"] after upload, where “file” is the input name in the form. There are PHP frameworks that help you work better with the temporary files though.

    How to use? In the php file containing the form:

    <form action="upload_file.php" method="post"
    enctype="multipart/form-data">
    <label for="file">Filename:</label>
    <input type="file" name="file" id="file" /> 
    <br />
    <input type="submit" name="submit" value="Submit" />
    </form>
    

    And then in upload_file.php:

    echo $_FILES["file"]["tmp_name"]
    

    Is this what you were asking for ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use SpinLock, but even this most basic code in a
I'm trying to use the new WCF Web API Preview 6 with Basic Authentication.
I'm trying to use basic Java code in Scala to read from a file
I have been trying to use an ajax-style file upload component (like the dojox
I'm trying to use the Server class from Cassini to include a basic web
I'm trying to use basic .htaccess authentication in a subdirectory of the root where
We are trying to use a basic @OneToMany relationship: @Entity @Table(name = PARENT_MESSAGE) public
I'm trying to use operator overloading to define the basic operations (+,-,*,/) for my
I'm trying to use FireWatir (1.6.5) to access a site using Basic Authentication and
So, I'm trying to use Doctrine to retrieve some data. I have some basic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.