HTTP_Upload
| From: | Cosmin Chiru | Date: | Mon, 24 Jul 2006 16:51:13 +0000 |
| Subject: | HTTP_Upload | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-24744@lists.php.net to get a copy of this message | ||
Hello!
I'm using HTTP_Upload in order to upload multiple files on some webserver.
Thing is, I also have to record in a database table the first picture
uploaded in one session.
Code looks like this:
// snip
// Upload market pics
$upload = new HTTP_Upload("en");
$files = $upload->getFiles();
$last_id = $_db->last_id();
foreach($files as $file)
{
if ($file->isValid())
{
$dest_name = $file->moveTo("images/market/");
$real = $file->getProp("real");
$sql = "INSERT INTO bursa_poze SET \n"
. "user_id = '1', \n"
. "bursa_id = '$last_id', \n"
. "poza = '$real'";
if ($_db->query($sql))
{
$result = "Datele au fost adaugate.";
}
}