4 Replies Latest reply on May 11, 2008 8:25 PM by (Jayceedxb)

    Uploaded image doesn't have extension

      Running on Apache with PHP 4.4 in local testing server environment, my form is just fine. It does everything what I want except that in the image upload part, the uploaded image doesn't carry the file extension along. I am uploading jpg files as is the permission. How can I have the uploaded file with original extension.
      Thanks
        • 1. Re: Uploaded image doesn't have extension
          Günter Schenk Level 4
          Hi,

          in case you defined a Custom Renaming Rule, you can add .{KT_ext} at the end to set the original file´s extension.

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Uploaded image doesn't have extension
            Level 1
            Thanks Günter.
            But that didn't work for me. First of all I am not using custom renaming rule. Even with custom renaming, KT_ext doesn't seem to work for me. I found a similar posting elsewhere here in the forum. There also no solution was discovered.

            Here is the fucntion:

            function Trigger_FileUpload(&$tNG) {
            $uploadObj = new tNG_FileUpload($tNG);
            $uploadObj->setFormFieldName("uplo");
            $uploadObj->setDbFieldName("Preview");
            $uploadObj->setFolder("images/");
            $uploadObj->setMaxSize(1500);
            $uploadObj->setAllowedExtensions("pdf, txt, jpg");
            $uploadObj->setRename("custom");
            $uploadObj->setRenameRule("{KT_name}.{KT_ext}");
            return $uploadObj->Execute();
            }
            • 3. Re: Uploaded image doesn't have extension
              Günter Schenk Level 4
              Hi,

              ----
              Here is the fucntion
              ----

              that sample function doesn´t help much, because it does contain a custom rename rule, but your own code not.

              Here comes some of my FileUpload code which works -- does it differ much from your code ?

              -------
              function Trigger_FileUpload(&$tNG) {
              $uploadObj = new tNG_FileUpload($tNG);
              $uploadObj->setFormFieldName("file_name");
              $uploadObj->setDbFieldName("file_name");
              $uploadObj->setFolder("../assets/");
              $uploadObj->setMaxSize(900);
              $uploadObj->setAllowedExtensions("pdf, txt, swf");
              $uploadObj->setRename("auto");
              return $uploadObj->Execute();
              }
              -------

              Can you please post the code of your page on your server (as .txt file) and provide a link to that ?

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Uploaded image doesn't have extension
                Level 1
                Hi,
                Thanks for your help.
                Now it is working fine. You know what I did, just deleted all the previous files and started afresh. Seemingly there was some issue with the fileds. Somewhere I messed it up. But now, everything seeems to be working fine.
                Thanks for your time and support.
                Jay