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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:47:39+00:00 2026-06-09T04:47:39+00:00

I am trying to allow users to upload videos via this form <form method=’POST’

  • 0

I am trying to allow users to upload videos via this form

       <form method='POST' name='uploadform' enctype='multipart/form-data' action=''>
                                Video: <input type='file' name='filename' /><br/>
                                       <input type='submit' name='cmdSubmit' value='Upload' />";

Then with this php script I am trying to move the videos into another folder for storage.

            if($_POST['cmdSubmit']){
                            $filename = basename($_FILES['filename']['name']);
                            move_uploaded_file($_FILES['filename']['tmp_name'], "videos/" . $filename);
                    }

The problem I am having is the video’s are not being moved to my folder. I have done research on how to do this and have try many error solving methods but nothing is seeming to work so if you have any idea on what my problem is any help is appreciated. The form works perfectly. Thanks….

I have searched google and youtube and can’t find any really good articles on this if you know any that would be awesome too.

I tried to do troubleshooting by using this code..

if(move_uploaded_file($_FILES['filename']['tmp_name'], "videos/" . $filename)){
                                echo "This worked Successfully";

                            }else{
                                echo "Error";   
                            }
                    }

and it did not echo either statement….

  • 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-09T04:47:41+00:00Added an answer on June 9, 2026 at 4:47 am

    Try the below PHP code
    in this code you can have some Restrictions on Upload
    you can set the Exts that you need to allow in upload..

    HTML FORM CODE

    <html>
    <body>
    <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>
    </body>
    </html> 
    

    PHP CODE BELOW

    <?php
    $allowedExts = array("jpg", "jpeg", "gif", "png");
    $extension = end(explode(".", $_FILES["file"]["name"]));
    if ((($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    && ($_FILES["file"]["size"] < 20000)
    && in_array($extension, $allowedExts))
      {
      if ($_FILES["file"]["error"] > 0)
        {
        echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
        }
      else
        {
        echo "Upload: " . $_FILES["file"]["name"] . "<br />";
        echo "Type: " . $_FILES["file"]["type"] . "<br />";
        echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
    
        if (file_exists("upload/" . $_FILES["file"]["name"]))
          {
          echo $_FILES["file"]["name"] . " already exists. ";
          }
        else
          {
          move_uploaded_file($_FILES["file"]["tmp_name"],
          "upload/" . $_FILES["file"]["name"]);
          echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
          }
        }
      }
    else
      {
      echo "Invalid file";
      }
    ?> 
    

    For Any Other Reference kindly Check Here http://w3schools.com/php/php_file_upload.asp Or Post A Comment

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

Sidebar

Related Questions

I'm trying to allow users to post videos on my site by supplying only
I'm trying to allow users to upload an image by an html form, and
I'm trying to create a dialog which will allow users to upload an image.
I'm trying to allow users to register on my web application via Facebook. As
I am trying to allow users to upload files for a django app running
I'm trying to allow users to upload a profile image on their user profile
I am trying to allow multiple file uploads prior to a form post. What
i am trying to allow users to update their profile picture using this code.
I am trying to allow the users of my website, to upload images and
I'm trying to allow users to upload photos to the server and then view

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.