8 Replies Latest reply on Mar 18, 2008 9:51 AM by (hicham_hage)

    File Upload Problem please HELP

      hey, im trying to create a file upload/download web application using ADDT, but i have a problem

      when i select a file to upload the script will add a new row to the database but will not add the file name,under the column 'file_name'

      here is what the table looks like in PHPMYADMIN
      http://www.one-way.biz/eg.jpg

      and also when i go to the directory where iv set it to save the uploaded files to, the file is there, and has been suceesfully uploaded

      so if anybody can help me please by telling me how to get it to add the file name to the database i would me much aprieciated, thanks

      dtcapener at One Way Productions
      http://www.one-way.biz
        • 1. Re: File Upload Problem please HELP
          Günter Schenk Level 4
          Hi,

          that´s certainly somewhat weird, because it usually works straight away -- I have some questions:

          1. does you form just have one file field ? I´m asking this, because some folks might add several file fields to a custom form and just reference the wrong one in the "File Upload" ~ "Basic" tab´s "Select form file field" menu

          2. if your form has just one file field, as I assume, how did you "name" it in the DW inspector ?

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: File Upload Problem please HELP
            Level 1
            My form has only 1 field, now sorry, but i am new to php so please could you explain things more if u woulndt mind!
            cheers

            dtcapener at One Way Productions
            http://www.one-way.biz
            • 3. Re: File Upload Problem please HELP
              Günter Schenk Level 4
              Hi Danny,

              usually I would now have asked you to post the page code here, but as these forums often wreck havoc with posted code, I will be contacting you offline and ask you to send me the following per email:

              1. your page
              2. an SQL dump of the table where it´s getting inserted to

              see ya later,

              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: File Upload Problem please HELP
                Hi,

                I am having the same problem.

                I was hoping to know how it was fixed!

                Thx.
                • 5. Re: File Upload Problem please HELP
                  glensbo Level 1
                  All

                  How did you set up Dreamweaver?
                  Go to "Site" in the menu
                  Open "Manage Sites"
                  Open "Local Info"
                  Look how you handle "Links relative to" in fourth line.
                  Either Document or Site Root.

                  My experience is that if you have ticked relative to Site Root you will experience a lot of problems with ADDT as it inputs a wrong path.

                  This said possibly you need to figure out if your path is correct

                  //start Trigger_FileDelete trigger
                  //remove this line if you want to edit the code by hand
                  function Trigger_FileDelete(&$tNG) {
                  $deleteObj = new tNG_FileDelete($tNG);
                  $deleteObj->setFolder("../images/");

                  I have experienced that I need to change the path that is given by ADDT. Look at your remote files and look for a folder that is suddenly created with the right name but the wrong location. Pure trial and error - end of the night it works pretty nice!

                  Regards
                  • 6. Re: File Upload Problem please HELP
                    Level 1
                    Hello Henrik,

                    the problem I am having is not with the file itself. the file is being uploaded, but the database entry does not contain the file name, instead all I get is an ''.

                    Cheers,
                    Hicham
                    • 7. Re: File Upload Problem please HELP
                      glensbo Level 1
                      Hicham
                      I had the same problem.

                      I used the "Create dynamic List Wizard" and the "Create Dynamic Form Wizard".

                      My major problem was the Permissions at the server, but next it was the above described solution.

                      With the settings I got the text info and the date info into the database - but no data for the image.

                      (I also increased the varchar field in the database to 200 - I have forgotten what it was before - it might have been too short - Well I'm not sure)

                      It can be because of the different steps for the trigger???

                      I can provide you a link if you e-mail me.

                      Regards
                      • 8. Re: File Upload Problem please HELP
                        Level 1
                        I found the problem. The table into which I save the file information did not have a primary key column. Adding a primary key fixed the issue.

                        Hicham