Solved

PHP initiating an FTP protocol file upload?

Posted on 2007-04-10
7
320 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

757 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

22 Experts available now in Live!

Get 1:1 Help Now