I know this is not the best Tutorial in the world but if you have questions shoot me a pm and i will help you with the script......
There are a few things you will need to get started....
1. Domain(free or purchased)
2. Hosting shared or vps
3. The upload Script (can be found here)
Make a directory called private or something else and edit the script....
Chmod the directory to 777
then go to the script nameoffile.php select your file and click upload... Then you will get a direct link.....
There are a few things you will need to get started....
1. Domain(free or purchased)
2. Hosting shared or vps
3. The upload Script (can be found here)
Code
<?php
$uploadpath = 'private/'; // directory to store the uploaded files
$max_size = 2000; // maximum file size, in KiloBytes
$allowtype = array('bmp', 'gif', 'jpg', 'jpe', 'zip', 'exe'); // allowed extensions
if(isset($_FILES['fileup']) && strlen($_FILES['fileup']['name']) > 1) {
$uploadpath = $uploadpath . basename( $_FILES['fileup']['name']); // gets the file name
$sepext = explode('.', strtolower($_FILES['fileup']['name']));
$type = end($sepext); // gets extension
$err = ''; // to store the errors
// Checks if the file has allowed type, size, width and height (for images)
if(!in_array($type, $allowtype)) $err .= 'The file: <b>'. $_FILES['fileup']['name']. '</b> not has the allowed extension type.';
if($_FILES['fileup']['size'] > $max_size*1000) $err .= '<br/>Maximum file size must be: '. $max_size. ' KB.';
// If no errors, upload the file, else, output the errors
if($err == '') {
if(move_uploaded_file($_FILES['fileup']['tmp_name'], $uploadpath)) {
echo 'File: <b>'. basename( $_FILES['fileup']['name']). '</b> successfully uploaded:';
echo '<br/>File type: <b>'. $_FILES['fileup']['type'] .'</b>';
echo '<br />Size: <b>'. number_format($_FILES['fileup']['size']/1024, 3, '.', '') .'</b> KB';
echo '<br/><br/>File address: <b>http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$uploadpath.'</b>';
}
else echo '<b>Unable to upload the file.</b>';
}
else echo $err;
}
?>
<div style="margin:1em auto; width:333px; text-align:center;">
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
Upload File: <input type="file" name="fileup" /><br/>
<input type="submit" name='submit' value="Upload" />
</form>
</div>Make a directory called private or something else and edit the script....
Chmod the directory to 777
then go to the script nameoffile.php select your file and click upload... Then you will get a direct link.....




