Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5440
  • Last Modified:

php FTP upload with progress bar

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
Evan Cutler
Asked:
Evan Cutler
  • 4
  • 3
  • 2
  • +2
1 Solution
 
gr8gonzoConsultantCommented:
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
 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Thanks but I don't have the choice.
I need to upload via ftp, and use the browser.
Maybe Java?
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
gr8gonzoConsultantCommented:
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
 
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
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
 
lesouefCommented:
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
 
gr8gonzoConsultantCommented:
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
 
lesouefCommented:
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
 
gr8gonzoConsultantCommented:
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
 
lesouefCommented:
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

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now