Quote sanishan said: View Post
Asalam o alikum!

Janam askfriends may sirf yeh kahna chahta hon kay agar app apni stie per uploading rakhain gay to yeh bahoot hi mushkil kaam hay... app apni site per koi chota sa script laga kay file upload kar saktain hain lakin... kuch hacker Shell ko jpg yah direct php asp may upload kar kay app ki site ko down kar saktain hain with in few sec. baar hal may app ko file uploading ka script day raha hon. is ki koi girecnty nahi hay.. kah yeh shell ko rook sakay....

PHP Code:
<?php header('Content-type: application/vnd.wap.xhtml+xml'); ?>
<?php 
echo '<?xml version="1.0"?' '>'?>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>File Upload Example</title>
  </head>

  <body>
    <h1>Data Received at the Server</h1>
    <hr/>
    <p>

<?php
foreach ($_POST as $key => $value){
?>

<b>Name-value Pair Info:</b><br/>
Field name: <?php echo $key?><br/>
Field value: <?php echo $value?><br/><br/>

<?php
}

$optionalFileName $_POST['filename'];

if (
$_FILES['myFile']['error'] == UPLOAD_ERR_OK){
  
$fileName $_FILES['myFile']['name'];
?>

<b>Uploaded File Info:</b><br/>
Content type: <?php echo $_FILES['myFile']['type']; ?><br/>
Field name: myFile<br/>
File name: <?php echo $fileName?><br/>
File size: <?php echo $_FILES['myFile']['size']; ?><br/><br/>

<?php
  
/* Save the uploaded file if its size is greater than 0. */
  
if ($_FILES['myFile']['size'] > 0){
    if (
$optionalFileName == "")
      
$fileName basename($fileName);
    else
      
$fileName $optionalFileName;

    
$dirName '/file_uploads/';    // <--- link to your Folder Jasay Images or other

    
if (move_uploaded_file($_FILES['myFile']['tmp_name'], $dirName $fileName)){
?>

<b>The uploaded file has been saved successfully.</b>

<?php
    
}
    else{
?>

<b>An error occurred when we tried to save the uploaded file.</b>

<?php
    
}
  }
}
?>

    </p>
  </body>
</html>


Yeh Kaam nahin karegy orr shayad aap Banned na ho jaen....

if i think... Main apko uploading wali Script donga single.php k naam se jis main aap password protect and multi uplaod with change directory and create delete bhi kar sakty hain.. Mean File Managment Thanks..