Neil Munro - 2003-12-18

Logged In: YES
user_id=933649

<p>It's very easy when you know how...
<code>
include "Snoopy.class.php";
$snoopy = new Snoopy;
$vars=array();
//OPTIONAL: form POST parameters e.g. $vars["upload"] = "1";
$upload_files["userfile"] = "/here/file.txt";
$snoopy->set_submit_multipart();
$snoopy->submit
("http://site.com/upload.php",$vars,$upload_files);
</code>

<p>At the other end in upload.php:

<code>
//OPTIONAL: test form parameters e.g. if(isset($_POST
["upload"])) ...
if($_FILES['userfile']['size'] != 0) //should also check type,
max size, etc.
copy($_FILES['userfile']['tmp_name'],"/there/.$_FILES
['userfile']['name']");
</code>

Neil Munro (neil.munro A T catalyse.net)