Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » PHP » General » Downloads
Add your own
alternative version

PHP SimpleSix Uploader

, 9 Apr 2012 CPOL
A simple file uploader written in PHP.

	$file = $_FILES['file'];
	$name = $_POST['name'];
	$path = $_POST['path'];
	$upload = $_POST['upload'];
				if(strlen($path) > 5){
					move_uploaded_file($file['tmp_name'], $path.$name);
					echo "<font color=green>File successfully uploaded!</font>";
				} else 
					echo "<li> Please enter the path!";
			} else 
				echo "<li> Please put the file name!"; 
		} else 
			echo "<li> No file to upload";
		echo "<br /><hr />";

?><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form method="post" enctype="multipart/form-data">
    <td height="40" colspan="2"><h2><strong>Uploader</strong></h2></td>
    <td height="25">File:</td>
      <input name="file" type="file" id="file" size="35">
    <td width="1%" height="25" nowrap>Re-name file:&nbsp;</td>
      <input type="text" name="name" id="name">
    <td height="25" bgcolor="#FAFAFA">Path to:</td>
    <td bgcolor="#FAFAFA"><label>
      <input name="path" type="text" id="path" size="30">
      <em>(ex. folder/dir/.../)</em></label></td>
    <td height="25">&nbsp;</td>
      <input type="submit" name="upload" id="upload" value="Up..">
    <td height="10" colspan="2">&nbsp;</td>
    <td height="10" colspan="2"><em>Uploader path: <?= getcwd(); ?></em></td>
<p>Author: <strong>Agon Avdimetaj</strong></p>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Agon Avdimetaj
CEO Graphsix Studio
Albania Albania
CEO / Web & App Developer @ Graphsix Studio.
Studying Computer Engineering @ Faculty of Electrical and Computer Engineering, UP.
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150123.1 | Last Updated 9 Apr 2012
Article Copyright 2012 by Agon Avdimetaj
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid