tags:

views:

68

answers:

1

hi frnds my requirement is that i want upload both folder and files is that possible?i am using following code for uploading the files also i want 2 upload the folders can anyone send the code

<?php

$target_path = "../mt/sites/default/files/ourfiles/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['uploadedfile']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the file, please try again!";
}



$con = mysql_connect("localhost","mt","mt");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }else{
 echo "Connected";
}

// Create table
mysql_select_db("mt", $con);

mysql_query("INSERT INTO mt_upload (FileName, FilePath)
VALUES ('".basename( $_FILES['uploadedfile']['name'])."', '".$target_path.basename( $_FILES['uploadedfile']['name'])."')");


// Execute query
mysql_query($sql,$con);

mysql_close($con);



?>
+1  A: 

I imagine you'll have to write a Flash or Java applet in order to do recursive file uploading and send directory info back to server.

I suggest you try to look for a project already out there or pay someone who is capable of producing a solution.

EMPraptor
I'm not sure about Flash but a Java applet will definitely do it.
kitsched