View file aiv2 AutoIndex/panel/upload.url.php

File size: 2Kb
<?php
include ('../config.php');
$page='upload';
include ('session.php');
include ($config->real() . $config->header);
?>
<?php
if($layout=='web'){?>
<div class="wrap">
<div style="float: left; width: 18%; margin-bottom: 5px;" class="container">
<?php include('sidebar.php'); ?>
</div>
<div style="float: right; width:80%;">
<?php
}?>
<div class="container"><div class="title">URL Upload</div>
<?php if($layout=='web'){
echo '<div style="padding:5px;">';
}?>
<?php
if (isset($_POST,$_POST['dir'],$_POST['url']) and is_array($_POST['url']))
{
foreach($_POST['url'] as $url){
$filename = basename($url);
$ext = $func->ext($filename);
if($url!=='http://'){
if (in_array($ext, explode(',',$config->ext)))
{
$newname ='../'.$config->filedir. $_POST['dir'] . '/' . $filename;
if (!file_exists($newname))
{
if (copy($url,$newname)===true)
{
echo "It's done! The file has been saved as: " . $filename.'<br />';
} else
{
echo "Error: A problem occurred during file upload!<br />";
}
} else
{
echo "Error: File " . $filename . " already exists<br />";
}
} else
{
echo "Error: Only files with extension of $config->ext under 2mb are accepted for upload<br />";
}}
}
} else
{
if (isset($_POST['upload']))
echo "No file Uploaded!";
else
echo "Select a file!";
}
?>
  <form action="upload.url.php" method="post">
Directory: <input type="text" name="dir" value="/" /><br />
URL: <input name="url[]" type="text" value="http://" /><br />
URL: <input name="url[]" type="text" value="http://" /><br />
URL: <input name="url[]" type="text" value="http://" /><br />
URL: <input name="url[]" type="text" value="http://" /><br />
URL: <input name="url[]" type="text" value="http://" /><br />
<input type="hidden" name='upload' value="d_upload" /><br />
<input type="submit" value="Upload" />
  </form>
<br />In Directory Part: / = <?php echo '../'.$config->filedir; ?>
  </div>
</div>
<?php if($layout=='web'){
echo '</div></div></div>';
}
?>
<?php
include ($config->real() . $config->footer); ?>