This content has been marked as final. Show 13 replies
Put the uploaded logo in a database table. Search this forum for "database image" or google "coldfusion database image" and you'll find various threads on the topic. It's very simple, especially if you are using MX7 or 8.
That's what I am doing. I write the file name to a database and use that to show the image. Problem is, I don't know which server the load balancer will send the user to. So when they upload the logo, it displays half the time. Am I missing something?
No, you don't just write the file name to the database, you write the entire file contents to the database.
Do you know for sure this will work using sql server 2000. I've been trying now for a little while, and I think my data types don't match.
Yes - both methods work with SQL Server 2000.
sweet...got it to work. I had to set my data type to image instead of binary. Thanks so much.
> sweet...got it to work. I had to set my data type to image instead of binary. Thanks so much.
This is a really awful solution if the logo needs to be served up on a
regular basis. Just because one CAN store a file in a DB doesn't mean one
SHOULD. Files belong in the file system. You're much better off storing
your logo as a file.
With your original CFFILE issue, you have to realise the file ops are being
called by the login account that CF uses to start its service, as and that
user is - by default - either "localsys" or "nobody". Those users
generrally don't have access to resources on remote boxes. If you need the
CF server to have access to a remote box, you need to start it as a user
that has permissions to said box.
quote:I fully agree with your statement that just because you CAN...doesn't mean you should BUT there is not enough information in this thread to come to the conclusion that this is an awful solution.
Originally posted by: Newsgroup UserThis is a really awful solution if the logo needs to be served up on a regular basis. Just because one CAN store a file in a DB doesn't mean one SHOULD. Files belong in the file system. You're much better off storing your logo as a file.
The only known fact is that multiple servers are being used with load balancing. It is not know if these logos are regularly served so the overhead associated with this process may be moot. The size of the images are not known -- if they are small, query caching can be used to compensate for the speed difference between a "real file" vs. a "database file."
Is a third-party hosting provider being used? If so, most will not allow access to a shared server like you describe (at least not without a heafty setup and monthly fee).
Finally, this shared directory you describe must be in the DMZ or you'll have to open up your internal firewall policies to allow the access -- both options have raise security concerns.
Bottom line: Is is the best solution -- I don't know. But based on the information available in this thread, I don't see how you can know either.
Sorry, I just reread your post and I see you did qualify your statement: "This is a really awful solution if the logo needs to be served up on a regular basis."
Please ignore my rant.
> Sorry, I just reread your post and I see you did qualify your statement: "This is a really awful solution if the logo needs to be served up on a regular basis."
> Please ignore my rant.
I think your response was valid and makes some good points.
There's no such thing as *too much* advice.
I was thinking about this a little further and there is no reason why these two concepts couldn't be made into a hybrid model to get the best of both worlds.
Upload the file to a local directory. Upon upload, store the file into a table with name, size and date/time information. LEAVE the file available for use. When the image is requested, check and query the table for the file header info. If you have a local copy and the header info agrees, simply send the file. If not, grab the file out of the table, save it and now send it.
This way, files will be available to both (or more) servers but the actual serving of the files will come from a local copy of the file.
I was able to manage to upload to both of my servers. I had to change the coldfusion services on each machine to run using an account that had rights to both servers. Once I did that, I used 2 <cffile> tags. For the destination, I put one servers ip, then the other servers ip for the other. Everything works like a charm now.
Thanks for the help.