|
<?
$file = $_FILES['file'];
$name = $_POST['name'];
$path = $_POST['path'];
$upload = $_POST['upload'];
if(isset($upload)){
if($file['name']){
if($name){
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">
<tr>
<td height="40" colspan="2"><h2><strong>Uploader</strong></h2></td>
</tr>
<tr>
<td height="25">File:</td>
<td><label>
<input name="file" type="file" id="file" size="35">
</label></td>
</tr>
<tr>
<td width="1%" height="25" nowrap>Re-name file: </td>
<td><label>
<input type="text" name="name" id="name">
<em>(ex.filename.txt)</em></label></td>
</tr>
<tr>
<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>
</tr>
<tr>
<td height="25"> </td>
<td><label>
<input type="submit" name="upload" id="upload" value="Up..">
</label></td>
</tr>
<tr>
<td height="10" colspan="2"> </td>
</tr>
<tr>
<td height="10" colspan="2"><em>Uploader path: <?= getcwd(); ?></em></td>
</tr>
</form>
</table>
<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.
CEO / Web & App Developer @ Graphsix Studio.
Studying Computer Engineering @ Faculty of Electrical and Computer Engineering, UP.