Upload to ftp server

Is there a way to use CUploadedFile or maybe an extension (I’ve been trying this one) to upload a file to an ftp server?

I have a site that will allow users to upload videos, photos, and pdf’s to the server, but I don’t want uploading to use lots of my bandwidth, as some of the videos may be very large.

I’m looking for a way for my server to “push” the uploaded files to another server/computer.

I think you’d have to do some PHP coding for this, but I’m not sure if it is possible to redirect a file upload from a client to another server without passing through the server doing the redirection - personally I doubt it.

That’s what I thought…

Hypothetically, what if there was a "local webserver" near the client; would it be possible for that server to "push" the upload to the media server?


Is it possible to get the location of a file on the client computer and then run an ftp upload to an ftp server?

As far as I am aware that is completely impossible - when a client uploads a file, at no time does it give the server access to its files - it just tells the server that it is sending it a file and sends the binary content of the file.

For the local web server, I suppose that depends what you mean. If you have some system on your main web server to detect a client’s location and then you redirect the client to another web server, then there’s nothing to stop that more local web server forwarding the file somewhere else, but you would, of course, need to have your/a web application on the local web server to generate the appropriate forms and do the work for you, which if you’re using any kind of validation mechanism etc may well boil down to having most of your site on it.