10 Replies Latest reply on Feb 15, 2007 1:24 PM by pblecha

    Upload file to replicated servers?

    pblecha
      I'm trying to figure a way to upload a file to load-balance replicated servers using the CFFILE tag. EDITED**** I'm successfully uploading to whichever server the user is on at the time; but I need to figure a way to copy over to the other server. I have tried using UNC paths in the CFFILE tag; however, it continues to not find those paths. I have been told that Coldfusion is indeed configured to allow the use of UNC paths; as far as I can tell, the path is correct (at least, it's valid in Visual SourceSafe), but I still get a non-existent directory error (I'm throwing that error to myself).

      Can anyone explain to me how one would use a UNC path in a CFFILE tag for uploading? Or, conversely, if I were to map to a virtual directory on the server, how would I call on that in the tag?
        • 1. Upload file to replicated servers?
          jdeline Level 1
          Would it be feasible to add a table to the database that contains the fields filename and image? I don't know if this will work, but you could store the image in the database, retrieve it using WHERE filename = #myImage# and change your code to something like the concept code below.
          • 2. Upload file to replicated servers?
            insuractive Level 3
            Or, if you didn't want to move things to the database, you could use <CFFTP> to move the file to the other server (you should be able to use the CGI variables on the active server to determine which server needs to be updated). This would give you a pretty quick sync. If you are not too concerned about the speed of the sync, I would recommend going with a 3rd party softward package like http://www.superflexible.com/ - We're currently using them - the software is easy to configure and you can set it up to automatically update if a change is made to a directory.

            As for the UNC path - it sounds like you should check with the folks who mentioned that UNC is supported by CFFILE. What OS are you using? If its Microsoft, you should be able to map a network drive and that would give you a full absolute file path to your other server (assuming they are on the same network)
            • 3. Re: Upload file to replicated servers?
              Level 7
              > Unfortunately, it isn't possible to configure
              > Administrator to log CF into the network with those access privileges necessary
              > to use UNC's; but is there another way to do this?

              WHY is this not possible?

              --
              Adam
              • 4. Re: Upload file to replicated servers?
                dempster Level 1
                I've been able to use UNC paths with CFFILE to upload files successfully. One thing I found that you need to do is to upload to the primary server so that the file is then replicated to the other servers. If you're having problems, it is probably related to the permission ColdFusion has on the network. Although if you're getting an error that the directory is not found, perhaps your UNC reference is incorrect. Are you working with a server administrator who can help you troubleshoot this?
                • 5. Re: Upload file to replicated servers?
                  pblecha Level 1
                  That's why I edited the message; I found out that it's already configured that way.
                  • 6. Re: Upload file to replicated servers?
                    pblecha Level 1
                    quote:

                    WHY is this not possible?


                    That's why I edited the message; I found out that it's already configured that way.
                    • 7. Re: Upload file to replicated servers?
                      Level 7
                      > That's why I edited the message; I found out that it's already configured that way.

                      Sorry, I'm reading these via the NNTP feed: it does not receive the edits.

                      --
                      Adam
                      • 8. Re: Upload file to replicated servers?
                        pblecha Level 1
                        quote:

                        I've been able to use UNC paths with CFFILE to upload files successfully. One thing I found that you need to do is to upload to the primary server so that the file is then replicated to the other servers. If you're having problems, it is probably related to the permission ColdFusion has on the network. Although if you're getting an error that the directory is not found, perhaps your UNC reference is incorrect. Are you working with a server administrator who can help you troubleshoot this?


                        I've been successful with testing UNC paths in uploading, so I know they'll work. I can also upload directly to the server using an absolute path; however, my webmaster wants me to find a solution that doesn't involve using the automated replication at the server level (for security reasons, and as a good learning experience for me).

                        I got the UNC path from the path in SourceSafe, so I am believing it's correct; however, I can ask to be certain.
                        • 9. Re: Upload file to replicated servers?
                          pblecha Level 1
                          quote:

                          Sorry, I'm reading these via the NNTP feed: it does not receive the edits.


                          No problem. :)
                          • 10. Re: Upload file to replicated servers?
                            pblecha Level 1
                            UPDATE: I have spent quite a bit of time with the webmaster looking into permissions for the server. We both verified that permissions for Coldfusion are sufficient to read and write. Just as a test, I wrote the code below. However, CF continues to bomb out. If I use a share on my local drive, it works just fine.

                            Any suggestions what might be preventing me from being able to write to the server, but if it's a locally based share (using the UNC path, though), it works?