Script to upload images and add to database?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jmev7

    Script to upload images and add to database?

    Is there a script that will allow upload of multiple images at once to
    a FTP server, and simultaneously write that list to a MySQL table? I
    need to allow users to do something like this.

    Thanks.
  • Pedro

    #2
    Re: Script to upload images and add to database?

    jmev7 wrote:[color=blue]
    > Is there a script that will allow upload of multiple images at once to
    > a FTP server, and simultaneously write that list to a MySQL table? I
    > need to allow users to do something like this.[/color]

    I doubt it very much.
    Probably the best approximation you'll be able to dig out
    will upload the multiple files *sequentially*.

    Apart from that, yes, I'm pretty sure there is.

    --
    I have a spam filter working.
    To mail me include "urkxvq" (with or without the quotes)
    in the subject line, or your mail will be ruthlessly discarded.

    Comment

    • jmev7

      #3
      Re: Script to upload images and add to database?

      Pedro <hexkid@hotpop. com> wrote in message news:<bnpg41$14 8ntn$2@ID-203069.news.uni-berlin.de>...[color=blue]
      > jmev7 wrote:[color=green]
      > > Is there a script that will allow upload of multiple images at once to
      > > a FTP server, and simultaneously write that list to a MySQL table? I
      > > need to allow users to do something like this.[/color]
      >
      > I doubt it very much.
      > Probably the best approximation you'll be able to dig out
      > will upload the multiple files *sequentially*.
      >
      > Apart from that, yes, I'm pretty sure there is.[/color]

      Actually, sequentially makes sense. I don't mind limiting myself to,
      say, 5 textboxes with "browse" buttons next to them. Then, the user
      selects 1-5 images, clicks "UPLOAD" (or submit, or whatever), and the
      upload begins, with the SQL statement to follow. I can figure out the
      SQL statement (I think) better than I can the array to step through.

      Any suggestions on code to lookup?

      Thanks

      Comment

      • Clubberboy

        #4
        Re: Script to upload images and add to database?

        Op 3 Nov 2003 07:17:38 -0800 schreef jmev7@yahoo.com (jmev7):
        [color=blue]
        >Actually, sequentially makes sense. I don't mind limiting myself to,
        >say, 5 textboxes with "browse" buttons next to them. Then, the user
        >selects 1-5 images, clicks "UPLOAD" (or submit, or whatever), and the
        >upload begins, with the SQL statement to follow. I can figure out the
        >SQL statement (I think) better than I can the array to step through.[/color]

        I think this script is what your looking for


        username: demo
        password: demo


        Comment

        • Bob

          #5
          Re: Script to upload images and add to database?

          jmev7@yahoo.com (jmev7) wrote in message news:<c72a6456. 0311030717.2e8c d97a@posting.go ogle.com>...[color=blue]
          > Pedro <hexkid@hotpop. com> wrote in message news:<bnpg41$14 8ntn$2@ID-203069.news.uni-berlin.de>...[color=green]
          > > jmev7 wrote:[color=darkred]
          > > > Is there a script that will allow upload of multiple images at once to
          > > > a FTP server, and simultaneously write that list to a MySQL table? I
          > > > need to allow users to do something like this.[/color]
          > >
          > > I doubt it very much.
          > > Probably the best approximation you'll be able to dig out
          > > will upload the multiple files *sequentially*.
          > >
          > > Apart from that, yes, I'm pretty sure there is.[/color]
          >
          > Actually, sequentially makes sense. I don't mind limiting myself to,
          > say, 5 textboxes with "browse" buttons next to them. Then, the user
          > selects 1-5 images, clicks "UPLOAD" (or submit, or whatever), and the
          > upload begins, with the SQL statement to follow. I can figure out the
          > SQL statement (I think) better than I can the array to step through.
          >
          > Any suggestions on code to lookup?
          >
          > Thanks[/color]

          Hi, First are you sure you wanna to use FTP, I think the best way is
          to use file upload build in in PHP or/and use GD2 wich is comes with
          php latest versions
          Here some exampe how to upload one photo :

          if (is_uploaded_fi le($_FILES['photo']['tmp_name'])) {

          $imtype=$_FILES["photo"]["type"];
          $imsize=$_FILES["photo"]["size"];
          $imname=$_FILES["photo"]["name"];
          $imtemp=$_FILES['photo']['tmp_name'];

          $im = add_image($imty pe , $title, $description, $sub_cat)
          or die("couldnt add photo");
          move_uploaded_f ile($imtemp, "im1/$im.$extension" );

          where function add_image adding imaage to DB!
          If you wanna to add multi. immages just use for()....


          Check my web site:

          Comment

          • jmev7

            #6
            Re: Script to upload images and add to database?

            Hi, I think I follow this code, but as a newbie to PHP, not for sure.
            Is this all I'll need, or do I need to write an "add_image( )" function
            to write to the database. If so, I'll have to stay up late figuring
            out the first line :)

            Thanks[color=blue]
            > Hi, First are you sure you wanna to use FTP, I think the best way is
            > to use file upload build in in PHP or/and use GD2 wich is comes with
            > php latest versions
            > Here some exampe how to upload one photo :
            >
            > if (is_uploaded_fi le($_FILES['photo']['tmp_name'])) {
            >
            > $imtype=$_FILES["photo"]["type"];
            > $imsize=$_FILES["photo"]["size"];
            > $imname=$_FILES["photo"]["name"];
            > $imtemp=$_FILES['photo']['tmp_name'];
            >
            > $im = add_image($imty pe , $title, $description, $sub_cat)
            > or die("couldnt add photo");
            > move_uploaded_f ile($imtemp, "im1/$im.$extension" );
            >
            > where function add_image adding imaage to DB!
            > If you wanna to add multi. immages just use for()....
            >
            >
            > Check my web site:
            > http://haifa.us[/color]

            Comment

            • Bob

              #7
              Re: Script to upload images and add to database?

              Hi
              First:

              if (is_uploaded_fi le($_FILES['photo']['tmp_name'])) {
              This line checks if you already have this image!

              Second: The pictures will be stored on your server,if that what you
              need! You may store your photos in DB as blob!

              this function will add file, name, ... to db:

              function add_image($file , $title, $description, $uid, $jid, $pswd) {
              $query="INSERT INTO t_images .......";
              execution....
              }




              jmev7@yahoo.com (jmev7) wrote in message news:<c72a6456. 0311121156.2bd8 53b9@posting.go ogle.com>...[color=blue]
              > Hi, I think I follow this code, but as a newbie to PHP, not for sure.
              > Is this all I'll need, or do I need to write an "add_image( )" function
              > to write to the database. If so, I'll have to stay up late figuring
              > out the first line :)
              >
              > Thanks[color=green]
              > > Hi, First are you sure you wanna to use FTP, I think the best way is
              > > to use file upload build in in PHP or/and use GD2 wich is comes with
              > > php latest versions
              > > Here some exampe how to upload one photo :
              > >
              > > if (is_uploaded_fi le($_FILES['photo']['tmp_name'])) {
              > >
              > > $imtype=$_FILES["photo"]["type"];
              > > $imsize=$_FILES["photo"]["size"];
              > > $imname=$_FILES["photo"]["name"];
              > > $imtemp=$_FILES['photo']['tmp_name'];
              > >
              > > $im = add_image($imty pe , $title, $description, $sub_cat)
              > > or die("couldnt add photo");
              > > move_uploaded_f ile($imtemp, "im1/$im.$extension" );
              > >
              > > where function add_image adding imaage to DB!
              > > If you wanna to add multi. immages just use for()....
              > >
              > >
              > > Check my web site:
              > > http://haifa.us[/color][/color]

              Comment

              Working...