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 8708055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:01:28+00:00 2026-06-13T04:01:28+00:00

I have an HTML web form where users can upload multiple files. I am

  • 0

I have an HTML web form where users can upload multiple files. I am having trouble with moving the files though.

HTML:

My HTML:

<form enctype="multipart/form-data" method="post" action="save.php">
    <input type="hidden" name="MAX_FILE_SIZE" value="500000"/>
    <input type="file" name="uploads[]" multiple="multiple" />
    <input type="submit" name="submit" value="submit"/>
 </form>

Save.php:

 <?php
     foreach ($_FILES['uploads']['name'] as $file) {
     $target= UPLOADPATH . $file;
     move_uploaded_file($file, $target)
     or die('error with moving the file');
      $file= time() . $_FILES['uploads']['name'];
         echo $file;
     }

The problem is with move_uploaded_file(). What could I be doing wrong?

  • 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-13T04:01:30+00:00Added an answer on June 13, 2026 at 4:01 am

    Try as below, you need to pass first parameter as file source

    foreach ($_FILES['uploads']['name'] as $key => $file) {
     $target= UPLOADPATH . $file;
    
     move_uploaded_file($_FILES['uploads']['tmp_name'][$key], $target)
     or die('error with moving the file');
      $file= time() . $_FILES['uploads']['name'];
         echo $file;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have made a small web application with form.html output.jsp ServletOne.java In the form.html,users
I have this problem: My web application has a form where the users can
I have a web form that users can fill out and that content fills
I have a simple HTML Form <form id=uploadForm method=post action=/cgi-bin/test.cgi enctype=multipart/form-data> <input type=submit name=add_something
I have an HTML page with a web form. Among other things, it includes
I have a web site that contains an HTML form, in this form I
I have a Greasemonkey script that dynamically inserts an HTML form into some web
in my PHP web application,I have a dataentry form where users will enter data
I have an asp.net web form with an html input and button at the
I've got a web where logged in users can fill out a form to

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.