Solved

php FTP upload with progress bar

Posted on 2009-04-07
11
5,032 Views
Last Modified: 2013-11-29
Greetings.
Does anyone know how to create an AJAX FTP upload bar with PHP?

I would like to upload large files (100meg or bigger) using PHP's FTP libraries....
but I want to track the progress....
Help?
0
Comment
Question by:Evan Cutler
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 24093370
The only one that I've seen that works pretty well is the uploader that comes with WordPress - you may want to download that and look at its code.

On another note, if you're using AJAX, then I'm assuming that you're uploading from a browser. If that's the case, then the file is first uploaded via HTTP before being transferred with FTP. One word of advice: uploading large files with a web browser doesn't usually work very well.

If you're dealing with a couple of megabytes, that is one thing, but I usually see uploads over 10-20 megabytes fail. The browsers time out or just stop transferring, and there is no good way to resume an upload with HTTP. That means if you're uploading a 100 megabyte file and it fails at 99 megabytes, you have to start all over again (and most of us have slow upload speeds).

Using a regular FTP client is far more reliable (SFTP if you can, since FTP is insecure). Most people have FTP clients that support SFTP, and if they don't, there are a lot of them for free (FileZilla for example).

0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 24093374
Thanks but I don't have the choice.
I need to upload via ftp, and use the browser.
Maybe Java?
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24093512
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 34

Expert Comment

by:gr8gonzo
ID: 24103183
Java (not Javascript) would probably be a better choice for upload large files. It's a little clunky - personally I try to never use Java, but it should be more reliable than trying to go through the browser's built-in capabilities.

Also - when you say that you don't have a choice, can I ask why?

If it's related to some sort of hosting restriction, you may also want to see if you have the ability to define the maximum upload size - many hosts don't let you upload more than10 megabytes per form post (sometimes less than that). It's a setting in the php.ini file and some hosts don't allow you to change it via the ini_set() function. If that's the case, then PHP won't work for you.
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 24103430
The thought here is that the customer wants to lock down the procedures.
Doesn't want an FTP client.  Want's a "browse" and "upload" click that can handle the size.

Java was the original thought.  I'm open to any solution if PHP, javascript, html, or Java

Thanks
0
 
LVL 28

Expert Comment

by:lesouef
ID: 24175253
how about this http://pagetruck.com ?
this is a customized version of an open source stuff, let me know if you wanna know more about it.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 24175419
I thought this question had been closed - oops.

As  I mentioned before, I'm not a fan of Java applets, but they're probably better suited for this. Googling for java applet upload gives good results - the first two are JUpload (open-source) and a nicer-looking uploader that needs purchasing:

http://www.javaatwork.com/java-upload-applet/demo.html
0
 
LVL 28

Expert Comment

by:lesouef
ID: 24175547
my solution uses none, pure http file upload... if it must be installed in strict sites where java is prohibited (administrations sometimes, etc...)
if you're on your way for java applets, see thinupload.com  (same guy as radinks) , one of the best for me.
I have some more links on my other PC if you're interested.
0
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 24177023
lesouef - I was just suggesting java applet because of the intended sizes of the files being uploaded (he mentioned 100 megabyte files, and large http uploads are prone to failure).
0
 
LVL 28

Expert Comment

by:lesouef
ID: 24178262
I do these currently. Unless your internet connection is on a boat, that fails rarely and my server is setup to accept 256MB.
And if the java applet is better it's because it has a resume feature, and therefore doesn't use the regular file upload of a web server which has no resume feature unfortunately. So an applet will be better if it has a specific server part to receive files or uses ftp to a ftp server which has a resume feature. But that is less standard and can't be implemented everywhere. So it really depends if you are intending the app to be used by a specific audience or a large audience. Applets will be forbidden by a lot of companies since they break quite a few internet safety rules like being able to write to the local disk.
0
 
LVL 14

Accepted Solution

by:
profya earned 500 total points
ID: 25162431
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
XML extra information 8 30
AJAX pass along a variable 3 46
simple html dom php accessing table/cell  values 4 23
Checking https returns 301 21 30
Please see preceding article here: http://www.experts-exchange.com/Networking/Operating_Systems/A_11209-Root-Bridge-Election.html Figure 1 After Root Bridge has been elected, then what?..... Let's start by defining a Root Port in la…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

830 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