6 Replies Latest reply on Jun 21, 2006 5:43 PM by gemckay

    upload issue

    gemckay
      I am trying to upload a file to the server using cffile. I want to force a filename(scheduleupload.mdb) and the location(C:\upload\schedule). This code works great on my test box. The upoaded file goes to C:\upload\schedule\SCHEDULEUPLOAD.MDB

      However, on my server, this same code is trying to create a folder called SCHEDULE.MDB and then placing the file into that folder, i.e. C:\upload\schedule\SCHEDULEUPLOAD.MDB\scheduletest.mdb where scheduletest.mdb is the filename uploaded. Any ideas why the same exact code would behave differently on 2 machines(both running xp)?

      Thanks
      Grant

        • 1. Re: upload issue
          BKBK Adobe Community Professional & MVP
          destination="c:\upload\schedule\"

          • 2. Re: upload issue
            gemckay Level 1
            Thanks for the reply. However I want to force the name of the file to SCHEDULEUPLOAD.MDB...
            • 3. Re: upload issue
              BKBK Adobe Community Professional & MVP
              However I want to force the name of the file to SCHEDULEUPLOAD.MDB
              That is what should happen when you use destination="c:\upload\schedule\". The destination attribute must be a folder. What you did earlier was to make it a file, which is incorrect.

              • 4. upload issue
                SafariTECH Level 1
                Actually he is using the format correctly ( and that's how it worked prior to the 701 updater), however there is a bug in MX701 if you have not yet applied the appropriate hotfix.

                Uploaded files, of "known" file extensions, will cause the server to create a directory of the file named, rather than upload the file. We had the same issue with images until we found the hotfix.

                After you apply the hotfix, it should work with the code you already have.

                http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=aae43964

                Your issue is # 61212
                • 5. Re: upload issue
                  BKBK Adobe Community Professional & MVP
                  Actually he is using the format correctly
                  Even if that worked before, it is a "forced" solution. Many of those are possible in Coldfusion. Luckily for us. However, some of them, like the present tend to lapse now and again. Notice that the fix is for ' cffile action="upload" no longer wrote a file with a file specification in the "destination" field. '

                  Now, go to the cffile manual. It defines destination as the "Pathname of directory in which to upload the file.". Hence, destination is a directory path, not a file path. My advice is that one should go by the book, especially when one is getting unexpected results.

                  • 6. Re: upload issue
                    gemckay Level 1
                    Thanks BKBK and SafariTech.... It seems my test server and prod server had different hotfixes on there. When I applied hotfix 2 to 7.01 as SafariTech suggested the problem was fixed. Thanks again for the help.