• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Upload file to replicated servers?

Explorer ,
Feb 12, 2007 Feb 12, 2007

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

708

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

That's why I edited the message; I found out that it's already configured that way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

quote:

WHY is this not possible?


That's why I edited the message; I found out that it's already configured that way.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

quote:

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


No problem. 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 14, 2007 Feb 14, 2007

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2007 Feb 15, 2007

Copy link to clipboard

Copied

LATEST
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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation