|
I have a free php file browser and file upload script, because its free there's obviously no support from the person who wrote the code but I want to make a couple of simple changes, I only want to browse 1 directory and I only want to upload to a specific directory.
Im just struggling to understand the code, this is the browse code snippit I think I need to edit:
function showContent($path){
if ($handle = opendir($path))
{
$up = substr($path, 0, (strrpos(dirname($path."/."),"/")));
echo "<tr><td colspan='2'><img src='style/up2.gif' width='16' height='16' alt='up'/> <a href='".$_SERVER['PHP_SELF']."?path=$up'>Up one level</a></td></tr>";
I thought I'd have to add the directory I want to browse into ($path."/.") but think Im wrong
With the upload file I want to have it in /admin but upload to admin/documents:
Again this is a snippit of code I think I need to edit but please help:
<?php
$target_path = $uploadLocation . basename( $_FILES['upfile']['name']);
if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
echo "The file: ". basename( $_FILES['upfile']['name']).
" has been uploaded!";
Thanks in advance
|