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

  • Home
  • SEARCH
  • 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 6643487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:03:21+00:00 2026-05-26T00:03:21+00:00

I am uploading a file to a server through an HTML form and then

  • 0

I am uploading a file to a server through an HTML form and then emailing the HTML form content to myself. I can store all the form values into PHP variables like this…

$name = strip_tags($_POST["name"]); 
$email = strip_tags($_POST["email"]);
$phone = strip_tags($_POST["phone"]);

but can not store the file name of the uploaded file in the same way. ex..

$uploadFile0 = strip_tags($_POST["uploadFile0"]);

I’m storing the file(s) to my server using a loop.

$i = 0;
    while(isset($_FILES['uploadFile'. $i])){
       echo 'item' . $i . 'present';
        $file_name = $_FILES['uploadFile'. $i]['name'];
        $file_name = stripslashes($file_name);
        $file_name = str_replace("'","",$file_name);
        $copy = copy($_FILES['uploadFile'. $i]['tmp_name'], $folderPath . $file_name);
        if($copy){
            echo "$file_name | uploaded sucessfully!<br>";
        }else{
            echo "$file_name | could not be uploaded!<br>";
        }
        $i++;
    };

Basically I want to capture the name of the file to a variable and echo it out in an email. I have a feeling I’m staring at the answer but I just can’t put it together. Thanks in advance for the help!

  • 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-05-26T00:03:22+00:00Added an answer on May 26, 2026 at 12:03 am

    Will $_FILES['uploadFile'. $i]['name'] not give you the name of the file?

    Or just to grab the first one $_FILES['uploadFile0']['name']

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

Sidebar

Related Questions

I have a html form for uploading a file, which is as follows: $uploadhtml
Criminals can fake the content type of the file he's uploading. So, if I
I am writing code for uploading a file from a client to my server
I have found numerous examples on uploading a file to a web server via
I am currently looking in to some file uploading using Java Server Faces. I've
I am uploading file(pdf for now) like this: (It is uploading content of file
When uploading a file (jpeg) via a form in IE7 I am seeing a
I am uploading a file through FTP that is 613.6 kb, it is a
I'm running a Solaris server to serve PHP through Apache. What tools can I
Say I want to have a server that can accept 2GB file over network,

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.