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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:47:22+00:00 2026-06-14T23:47:22+00:00

I want my client to be able to upload images from the back end

  • 0

I want my client to be able to upload images from the back end into the server. Please help me out. and also i need a php script to upload videos too. Thank you, here is my code and it is not working

<?php

// Configuration - Your Options
  $allowed_filetypes = array(

'.doc',

'.docx',

'.xls',

'.csv',

);  


  # array('.jpg','.gif','.bmp','.doc'); 

  // These will be the types of file that will pass the validation.
  $max_filesize = 1048567; // Maximum filesize in BYTES (currently 0.5MB).
  $upload_path = './files/'; // The place the files will be uploaded to (currently a 'files' directory).

 $filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
 $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.

 // Check if the filetype is allowed, if not DIE and inform the user.
 if(!in_array($ext,$allowed_filetypes))
  die('The file you attempted to upload is not allowed.');

 // Now check the filesize, if it is too large then DIE and inform the user.
 if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
  die('The file you attempted to upload is too large.');

 // Check if we can upload to the specified path, if not DIE and inform the user.
 if(!is_writable($upload_path))
  die('You cannot upload to the specified directory.');

// change the name of the file  
$docid = substr(md5(uniqid()),30);

 // Upload the file to your specified path.
 if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $docid.$ext))
     echo 'Your file upload was successful, Thank you'; // It worked.
  else
     echo 'There was an error during the file upload.  Please try again.'; // It failed :(.

?>
  • 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-14T23:47:23+00:00Added an answer on June 14, 2026 at 11:47 pm

    You have to increase time limit for video uploading in php.ini file

    max_execution_time = 3000 // 3000 or your requirements   
    

    And add the allowed type in array list

     $allowed_filetypes =
      array('.doc','.docx','.xls','.csv','.flv');  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to upload files from a client location to a server. At present,
I would like to upload file from the client to the server with a
I have a WCF Service that I want my client to be able to
I have a page with an image. I want the client to be able
In my Flex application, users need to be able to upload and download content.
I have a window service and i want it to be able to upload/download
I want to build an upload applet / desktop client that can resize -
does anybody know a good client-side, resize-before-upload, flash/java uploader? We need this terribly on
I have client/server data passing all working correctly. Text, Images, etc. My users create
I want to learn about the nuts-and-bolts of using SSL to secure client/server communication.

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.