Need help or pointers

Hi,
I am new to php, trying to upload files in a directory using an existing script that does upload by file names in an arrey. below is the code that does:
[php]<?php

require_once("./curlflickr.php");//chage to your directory
session_start();
$fk=new curlflickr;
$fk->api_key=“xxxxxxxxxxxxxxxxxxxxxxxxxxx”;
$fk->secret=“xxxxxxxxxxxxx”;

if(empty($_SESSION[$fk->sessionname])){
$fk->auth(“write”,TRUE);
}else {

$images[]=“1.jpg”;
$images[]=“2.jpg”;
$images[]=“3.jpg”;

$urls=$fk->umulty($images,“large”); // upload multiple files

foreach($urls as $url){
print “
”;
}

}
$fk=NULL;
?>[/php]

If I would like to upload all the files in a folder rather than naming then in an array like the above.

Please help me or give me a hint.
Thanks,

Hi see example below this will give you hint

$target_path = “uploads/”;

$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!”;
}

Sponsor our Newsletter | Privacy Policy | Terms of Service