Solved

PHP initiating an FTP protocol file upload?

Posted on 2007-04-10
7
336 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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 June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

717 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