At 16:55 12/19/2003 +0000, you wrote:
On Friday, December 5, 2003, at 05:31 pm, Brad Perkins wrote:
Now one of my clients wants fancy password protection for some pages which he needs to update regularly. I want to control the passwords/access using sessions in A4D, but I still want him to be able to FTP the updates. So, I was hoping I'd be able to include a remote URL in an A4D page, in the form:
<% include("http://www.com") %>
However, I assume this is not possible.
When you say include a remote URL I assume you mean the content of the page at the URL?
Yes, indeed.
Another (admittedly ugly) solution might be to have a4d call some ITK or 4DIC 4d code that would get the HTML for the page you want to include write the result to a file and have a4d include it.
I can see how that might work, but it does seem a bit extreme! The main problem would be that ITK would have to pick up the remote contents and write the file every time the A4D page was called up, because it would not know if it had been updated or not.
So, is it correct that there is no simple way to have A4D code retrieve the contents of a remote URL page, or does anyone have any further ideas?
I don't think there is a simple way. Is your situation as follows:
1) User can upload pages to an web/ftp server (server a) 2) Your Active4D Server resides on a a different server (server b)
You didn't say if the servers are on different networks. I've never tried this and don't even know if Active4D allows it, but if they are on the same network, or if server a can be mounted from server b, you might be able to set your active 4d include path to allow includes from the mounted volume?
A simpler solution might be to allow the user to upload the content to your Active4D server.
To display the uploaded content you ideally want it on server b. As you say, pulling it on the fly remotely is an option but isn't attractive. I think I mentioned the WebSTAR SSI/Web_Include plug-in in my previous post. Did you look into this? Even if that is a solution its basically doing the same thing that an ITK-based solution would. You also need to consider what to do if the remote page has images in it. Do you pull the images across and server them locally or do you reference them remotely.
Can you syncronize the content on the two servers? You'd need to script the remote upload folders on server a to transfer the content to server b when files are added, modified, or deleted.
The main problem would be that ITK would have to pick up the remote contents and write the file every time the A4D page was called up, because it would not know if it had been updated or not.
Another solution would be be have an unattended 4D process on server B routinely poll server A via FTP for changes and pull new files over. If your users could agree to an (up to n-minute) delay between their uploads and publishing this might work for you. If you do so this make sure that the 4DIC FTP process on server B doesn't have a negative impact on your A4D serving since 4DIC routines run syncronous.
hth,
Brad
