On Sat, September 30, 2006 4:29 am, Nick Wilson wrote: > i have thttpd (a very light weight http server) running as an image > server on one box, and users uploading images to another php/apache > powered box. > > I need to let users upload to the regular LAMP box, but then copy the > image over to the custom image server (which does not have php or any > kind of cgi capability). > > I was considering using exec() and scp to do this, but thought i'd ask > and see if anyone had any better suggestions? rsync Or do the images on the LAMP box go away? I'll bet that there's a configuration of rsync for that anyway, come to think of it. If rsync is "out", the difference between an "immediate" exec('scp') in PHP and an every-minute cron job is probably going to be moot, for most users, in most real-world scenarios, if you handle it right. Provide the user with some nice "eye candy" in between that will distract them from the fact that it takes 62 seconds for their photo to show up... For most of them, by the time they finish the upload and click on to the next page to view it, they've already burned 10 to 20 seconds anyway... Or, better yet, just take the upload, and then let them move on to whatever else they want to do, without giving them that immediate view of the photo. If you work at it, a good Usability can be achieved without the scp, almost for sure. You just have to keep the user informed of the status, so they know what's going on, and update that cleanly, so they are kept current on the status -- all without compromising security, nor over-loading the server with requests. A simple status indicator on your masthead/navbar of recent uploads -- "3 uploads in process" or "all uploads processed" is all you really need for this kind of app. Don't go all AJAXy and start burning up HTTP connections just to give them "instant feedback" -- They really don't care so long as: 1) They're kept informed as they do their tasks 2) They can force it to "check" if they've nothing better to do 3) The thing works fast and efficiently enough to be "nice" Start off with "Your photo has been uploaded and is being transerred to our super-fast photo servers. We'll keep you posted in your status bar, and you can just keep on working." after the upload. Honestly, I like to double-check the uploaded images, but not if it's gonna take THAT long while you dink around scp-ing them or whatever. Let me do something *else* while you're doing that, and I'll check on them later. Thanks. :-) -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php