Single File Uploads and Save into DB

  •  11-20-2012, 6:34 AM

    Single File Uploads and Save into DB

    Hi

    I'm reading alot about arays here and i think its not what i need

    I would like to do the following.

    Always Single file Uploads, Then Insert each filename into db and then refresh the page

     

    $uploader=new PhpUploader();
    $uploader->MultipleFilesUpload=false;
    $uploader->InsertText="Upload Another File (Max 10M)";
    $uploader->MaxSizeKB=1024000;    
    $uploader->AllowedFileExtensions="pdf";
    $BrokerUsername = $username;

    $uploader->SaveDirectory=$NewDirBrokerUploads;

    $uploader->Render();

     

    $filename = $mvcfile->FileName;

    if (!empty($filename)){
    $sqlinsert="INSERT INTO `uploads` (`id`, `username`, `filename`) VALUES ('NULL',".
    "'$username',". //username
    "'$filename');"; //filename
    mysql_query($sqlinsert, $link);

     

    header ('Location: brokerupload.php'); die (); exit (0);
     }

     

    But this does not work

    Can some help me with the correct code please.

     

View Complete Thread