Solved

PHP initiating an FTP protocol file upload?

Posted on 2007-04-10
7
332 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

738 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