We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

PHP Upload File to FTP Asynchronously

headzoo
headzoo asked
on
Medium Priority
531 Views
Last Modified: 2013-11-30
Howdy people,
  I've done plenty of uploading files to FTP servers with PHP, but only from my web host to the FTP server.  Is it possible to send a file straight from the browser to the FTP server?  Or more likely, start sending a file to the FTP server, while it's still being upload to the web server from the browser?

  I did some reading on ftp_nb_fput, and it almost seems like it would be possible for PHP to open the temporary file as it's being uploaded to the web server, and start sending it to the FTP server before it's done downloading.

  I'm not against using some JavaScript if that's needed.

- Sean
Comment
Watch Question

Author

Commented:
Oh yeah, I also don't care if I have to use some kind of cgi script to help out.
CERTIFIED EXPERT
Commented:
Well, if you're talking about uploading a file to your web server and having your web server send it to an FTP while you are STILL uploading it, I'm not sure that's really possible.  Even if it were, your server's upload speed is probably MUCH higher than the internet connection you're using (most cable and DSL lines are capped for upload speeds).  This means that if your web server was able to send the file as it was receiving it, it would likely run out of data to send before you finished uploading.

If you want to just open up an FTP connection in your web browser, just do this:

ftp://user:password@ftpaddress.com

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.