PHP Classes

File: upload.php

Recommend this page to a friend!
  Classes of Parsa Yazdani   Temporary PHP File Hosting   upload.php   Download  
File: upload.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Temporary PHP File Hosting
Host shared files to be downloaded for some time
Author: By
Last change:
Date: 5 months ago
Size: 385 bytes
 

Contents

Class file image Download
<?php
$filename
= time() . rand() . '_' . basename($_FILES['file']['name']);
if(
$_FILES['file']['size'] > 10000000)
    die(
'File too big');
if(!
move_uploaded_file($_FILES['file']['tmp_name'], 'uploads/' . $filename . '.stuf'))
    die(
'Failed to upload file');
file_put_contents('creation_date/' . $filename . '.sfdb', time());
echo
'<a href="download.php?file=' . $filename . '">File</a>';