Professional Web Applications Themes

send group of files at once to website administrator - PHP Development

Hi, I have the following code which I use to make regular backups of my databases. Is there a way to have all backup files sent at once after they are created, istead of presenting the list of files available for download? db_connect($dbuser, $dbpassword, $dbdatabase); // Lock and flush tables before backup $query = "LOCK TABLES un_article READ, un_article_writer READ"; $result = mysql_query($query) or error(mysql_error()); $query = "FLUSH TABLES"; $result = mysql_query($query) or error(mysql_error()); // Perform backup $query = "BACKUP TABLE un_article, un_article_writer TO 'c:/web/un/backup'"; $result = mysql_query($query) or error(mysql_error()); // Unlock tables $query = "UNLOCK TABLES"; $result = mysql_query($query) ...

  1. #1

    Default send group of files at once to website administrator

    Hi,

    I have the following code which I use to make regular backups of my
    databases. Is there a way to have all backup files sent at once after they
    are created, istead of presenting the list of files available for download?

    db_connect($dbuser, $dbpassword, $dbdatabase);

    // Lock and flush tables before backup
    $query = "LOCK TABLES un_article READ, un_article_writer READ";
    $result = mysql_query($query)
    or error(mysql_error());
    $query = "FLUSH TABLES";
    $result = mysql_query($query)
    or error(mysql_error());

    // Perform backup
    $query = "BACKUP TABLE un_article, un_article_writer TO
    'c:/web/un/backup'";
    $result = mysql_query($query)
    or error(mysql_error());

    // Unlock tables
    $query = "UNLOCK TABLES";
    $result = mysql_query($query)
    or error(mysql_error());

    // Present all files with link to download
    if ($handle = opendir('/web/un/backup')) {
    echo "Files:<br>\n";
    /* This is the correct way to loop over the directory. */
    while (false !== ($file = readdir($handle))) { echo "Download $file
    <a href='backup/$file'>here</a><br>\n";
    }
    closedir($handle); }

    --
    anders thoresson
    Anders Thoresson Guest

  2. #2

    Default Re: [PHP] send group of files at once to website administrator

    > Hi,
    >
    > I have the following code which I use to make regular backups of my
    > databases. Is there a way to have all backup files sent at once after they
    > are created, istead of presenting the list of files available for
    download?
    >

    send an email...

    there should be plenty of mime mailers around, just download the code, and
    use this as a bolt on to send your email with attachements. it's pretty easy
    once you've got the mime part setup and sorted. coding this yourself can be
    an tho... well, i think so anyway :p


    Skate Guest

  3. #3

    Default Re: [PHP] send group of files at once to website administrator

    Or you can use a zip class and create an archive. There are at least 2
    free classes that can create zip files.

    skate wrote:
    >>Hi,
    >>
    >> I have the following code which I use to make regular backups of my
    >>databases. Is there a way to have all backup files sent at once after they
    >>are created, istead of presenting the list of files available for
    >
    > download?
    >
    >
    >
    > send an email...
    >
    > there should be plenty of mime mailers around, just download the code, and
    > use this as a bolt on to send your email with attachements. it's pretty easy
    > once you've got the mime part setup and sorted. coding this yourself can be
    > an tho... well, i think so anyway :p
    >
    >
    >
    Marek Kilimajer Guest

Similar Threads

  1. Form in email to send cf data to website
    By alfior in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: April 26th, 08:51 PM
  2. Send pic from website??
    By Reload_Up_Your in forum Macromedia Flash
    Replies: 1
    Last Post: September 14th, 06:36 PM
  3. Send notification to my computer from a website... possible?
    By Toby Newman in forum PHP Development
    Replies: 4
    Last Post: July 23rd, 07:51 AM
  4. Replies: 0
    Last Post: July 12th, 04:59 AM
  5. Adding user to Local Group Administrator
    By tkotten in forum Windows Setup, Administration & Security
    Replies: 0
    Last Post: July 2nd, 10:32 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139