Solved

PHP initiating an FTP protocol file upload?

Posted on 2007-04-10
7
322 Views
Last Modified: 2013-12-13
Using PHP code, I wrote a program that will upload files to a webserver based on a browsed, local file reference.  If I upload a large file it can take 4 hours.  However, if I use an FTP client, it takes 10 minutes.  Now, I understand that FTP protocol is faster than PHP with forms, but is there a way, using PHP code to initiate and upload a file using an FTP protocol?  I want my PHP program to be as fast as an FTP client.

If it's possible-- does anyone have some sample code I could use?

thanks a ton

Normenclature
0
Comment
Question by:normenclature
  • 3
  • 2
  • 2
7 Comments
 
LVL 11

Assisted Solution

by:walkerke
walkerke earned 200 total points
ID: 18887133
I'm not sure I understand the question. Since PHP is a server-side scripting language, I must assume that you wrote a script that takes a file from an HTTP upload and stores the file on the web server. Again, since PHP is a server-side scripting language, it can only process what is presented to it by the visitor in the HTTP request. To my knowledge, it cannot process requests made by an FTP client. It also cannot initiate anything to happen on the client side using any protocol.
0
 
LVL 1

Author Comment

by:normenclature
ID: 18887264
So, you're saying there is absolutely no way on the client side even (JavaScript?) to make an FTP protocol upload like an FTP client?
0
 
LVL 11

Assisted Solution

by:walkerke
walkerke earned 200 total points
ID: 18887346
There may be some way in Javascript to initiate an FTP upload using their FTP client but I don't know how. Since Javascript is client side, it's possible. But not to perform an FTP upload using Javascript.

It is possible to use a Java applet which is downloaded to the client's browser to perform an FTP upload. I know this because I've seen one -- not because I know how to create one. That'd be a question for the Java forum.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 300 total points
ID: 18887786
An upload via HTMl/Javascript is only possible if the user specifies the file via the file-input box. Else everyone could hijack your files with a prepared server. The only way would be to have an applet which acts like an ftp-client and the applet must be trusted by the user.
If there are such big time differences between ftp and http- upload there must be something inbetween which throttles the HTTP- upload. The http-upload shouldn't take more than 25% of the ftp-upload. If it takes more either there is a problem with the webserver or a proxy.
0
 
LVL 1

Author Comment

by:normenclature
ID: 18911385
Are you saying that even with a 200 MB upload, if it takes an hour using FTP it should only take one hour and 15 minutes with an HTTP?

And if there is a problem with a proxy, what can be done about it?

n
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 300 total points
ID: 18911400
yup sending data via HTTP should not take much more bandwidth/time than sending it via ftp.

Detecting proxy/transparent proxies is very hard. You will need to check every point (if possible) where the IP-packages are trnasfered. Typical the network admin should know if there are proxies or the hosting company should tell you if there a any secuity measures which limit incoming traffic (e.g to prevent DOS-Attacks)
0
 
LVL 1

Author Comment

by:normenclature
ID: 18933709
OK-- thanks for all your help!
n
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now