Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: FTP Front-End (PHP Script?) for my bluehosted site

  1. #1
    Join Date
    Jan 2009
    Posts
    3

    Default FTP Front-End (PHP Script?) for my bluehosted site

    I've got a website hosted here on Bluehost, and would very much like to add a "client login" section, effectively a GUI front-end for my FTP space and accounts, so that clients can log-in, access their folder to upload or download audio files, and carry on about their business without having to have or understand an FTP client app (I know, I know)

    I've been googling my butt off today for php ftp scripts, and while there are some, I'm a complete neophyte to this stuff, and pretty much every one of them I've found is presented as just barebones code, and I'm far from Jedi enough to get what they do by looking at them that way .. I'm simply at a loss for what can be done, and frankly a bit surprised that there aren't more solutions (or that I've had such trouble finding them)

    Apologies if this has been covered in another thread -- the search engine rejected "ftp" as a search keyword, and I'm not seeing anything similar in the first few pages of this forum.

    SO..

    Any suggestions?

    Thanks
    -dave
    Last edited by dave-G; 01-31-2009 at 01:43 PM.

  2. #2
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    389

    Default

    It can't actually be done. While PHP has FTP functions, the script itself is server-side and cannot interact with the visitor in the way you're thinking. It would be like someone with an FTP server and client on the same machine, trying to download files from the visitor (who probably isn't running an FTP server on their computer).

    Here's some information on what PHP can do to upload files via HTTP, and this is the hotscripts category for file uploads (not all of which are free).

    And since you're going to be back later asking why you can't upload files bigger than 2mb, you need to put a php.ini file in your public_html folder containing something similar to
    Code:
    post_max_size = 30M;
    upload_max_filesize = 30M;
    and you need to go into PHP config under cPanel and tick "single php.ini" or "fastcgi" otherwise you need a copy of that php.ini file in every folder that needs the adjusted settings. And no, you don't need to keep any of the default settings inside your php.ini file.
    Have you tried turning it off and on again?

  3. #3
    Join Date
    Dec 2006
    Location
    Wisconsin
    Posts
    152

    Default

    What about something like this?
    http://extplorer.sourceforge.net/

  4. #4
    Join Date
    Jan 2009
    Posts
    3

    Default

    Thanks for the replies. And wysiwyg, I'll read-up a bit.

    If anyone has any further thoughts or suggestions, they're much appreciated.

    -dg

  5. #5
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,944

    Default

    Just remember that once file sizes go over 1Mb that using HTTP for upload becomes extremely slow (which is why the limit is usually set to 2Mb in the first place).

    If you turn on anonymous FTP with uploading allowed then people can upload files to your public_ftp/incoming folder and you can use the PHP FTP functions to retrieve the file from there.

  6. #6
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    389

    Default

    PHP should be able to use rename to move files once they're on the server, you don't need to use ftp functions.

    I also don't agree that HTTP is necessarily slower than FTP for uploading single files, regardless of size. Do you have anything to back that up?
    Last edited by wysiwyg; 02-18-2009 at 11:48 AM.
    Have you tried turning it off and on again?

  7. #7
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,944

    Default

    Quote Originally Posted by wysiwyg View Post
    I also don't agree that HTTP is necessarily slower than FTP for uploading single files, regardless of size. Do you have anything to back that up?
    The protocols themselves are defined that way.

    HTTP is specifically designed for delivering web pages to a browser. It therefore gives priority to the sending of files from the server to the browser. The messages from the browser requesting the pages are extremely spall relative to the even a tiny web page and so HTTP is set up to expect all of the traffic in the upload direction to be a few hundred bytes at most and usually only a couple of dozen bytes.

    FTP is specifically designed for transferring files and in order to make the file transfers themselves as fast as possible it allocates a second port for the instructions to be passed through.

    Basically HTTP is configured to expect requests one way and files the other while FTP has separate channels for files and requests and is therefore bidirectional for both.

    If there were not any difference in upload speeds between HTTP and FTP then there would be no reason for FTP to exist since if that were the case then HTTP would serve the same purpose.

    Using HTTP for file uploads does work but you are then trying to send transmissions that are hundreds of thousands of times the size that HTTP expects you to be sending in that direction (and that's assuming you don't increase the size limit) and since downloading always gets priority on HTTP all the ordinary requests for pages from the web server will be given most of the available resources by the web server. Provided no one is actually trying to access web pages on that server while the file upload is running then it might run almost as fast as with FTP but every web page being downloaded by anyone at the same time will slow it down. With FTP not only is the file upload using a completely separate service so that web page requests can't slow it down but also the actual control information etc is also using a separate port so that file transfers get full use of the port and the only competition for the resource are other file transfers.

  8. #8
    Join Date
    Jan 2009
    Posts
    3

    Default

    Thanks for the replies.

    I guess I'm at a loss here: my goal is to avoid having to have my clients configure and use an FTP client altogether, regardless of whether they're uploading to a public FTP folder or to an FTP account that I've created for them. I'm looking to provide a "client login" page linked from my website where they could log into their FTP account and upload or download files as needed.

    As I mentioned before, these will all be audio files, some quite large, so I am a bit concerned by the idea that any such thing would be very slow. As I've been looking around, I've found a few possibilities on hotscripts and sourceforge that seem like they could work, and there are some commercial solutions like Afian, PHPFileNavigator, FileRun, FTP Navigator,etc, but some of these appear to be overkill, or geared more towards doing the same thing that cpanel's own file manager does for me (if not for additional FTP users).. And I don't know if they would be up against the same transfer slowing that felgall describes.

    Another thought was to see if there were some way to customize the appearance of the apache-generated directory pages to look slightly more ... well .. 'custom'... I could then use something like FTP Maker to create preconfigured uploader apps for clients to upload their materials .. and then a simple url/password-protected-directory for downlads with the customized apache-ish thing... Is that even crazier?

    If all else fails, I'm looking at installing Rumpus on a MacMini and running a local server here, as it would do exactly what I'm looking for... But with all the space and transfer I have on my bluehost account, plus not having to worry about maintaining the server, it seems a waste not to find a way to use it, and I'm a little incredulous at the idea that it can't be done.

    Thanks again,
    -dave

  9. #9
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    4,944

    Default

    You do know that web browsers can be used to FTP files to an FTP server just by adding ftp:// on the front of the address don't you.

    There are instructions on the helpdesk at http://helpdesk.bluehost.com/kb/inde...od_id=2&id=449 on how to create FTP links in a web page.

  10. #10
    Join Date
    Jan 2008
    Location
    cardboard box
    Posts
    389

    Default

    Uh, most browsers do not have any FTP support at all.

    IE7, like firefox, has read-only support for FTP. Safari doesn't. I don't think opera does.

    I don't know the specifics for other browsers off the top of my head, but odds are they don't have FTP clients capable of upload built in.
    Last edited by wysiwyg; 02-18-2009 at 08:22 PM.
    Have you tried turning it off and on again?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •