SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Evangelist Redivider's Avatar
    Join Date
    Nov 2003
    Location
    PA
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Download from FTP site using PHP?

    OK, basically what I need to do is create a bunch of web pages that allow users to download files from an FTP server. The problem is, you need to use a username a password to login and the client obviously doesn't want to just put them in the URL and link directly to the files.

    I looked around at some "File Management" php scripts but they all seem way more complicated than what I need. All I really want to do is store the username and passowrd (or the whole path to the FTP folder) in an include file on the server and then use that to get to the files without having the username and password being passed directly with the URL. We don't need to track users or number of downloads or what files are on the server or anything like that. Just link to the files without putting the username and password in the URL.

    At lot of sites like Download.com and SourceForge use that thing where you click to download a file and then you get a new page where it says "You download will begin in 5 seconds..." That seems like what we need, but I'm not sure how compicated it is or if you can even do that with files on an FTP server.

    What is the best way to go about this?

  2. #2
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure the documents need to be downloaded via ftp?
    Why not just have them in a web directory and have a page of links to them, then simply clicking the link will download the file.

  3. #3
    SitePoint Evangelist Redivider's Avatar
    Join Date
    Nov 2003
    Location
    PA
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by streetlife
    Are you sure the documents need to be downloaded via ftp?
    Why not just have them in a web directory and have a page of links to them, then simply clicking the link will download the file.
    Honestly, I'm not sure. I mean, I know that's the way to do it. But for some reason they are convinced that FTP is better than HTTP for this kind of thing. They are going to be fairly big files.... hi-res posters and flyers and stuff like that.

    Convince me that it makes no difference. It'll make my life easier.

  4. #4
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't need to convince you! Test it out, see if you like, and if so, go with it.

  5. #5
    SitePoint Evangelist Redivider's Avatar
    Join Date
    Nov 2003
    Location
    PA
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess what I meant was help me convince them that FTP isn't necessarily any better than HTTP for serving file downloads. It doesnt really matter though. I think we'll just end up putting them on web server anyway.

  6. #6
    SitePoint Addict streetlife's Avatar
    Join Date
    Mar 2004
    Location
    D-Town
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly, without researching I wouldn't be able to tell you, but I do believe that for your needs and the amount it will be used, it is a perfect solution and will not bog down the webserver.
    I can tell you that the way download.com works is with an anonymous login, which is what you could do aswell, that could work too.


Bookmarks

Posting Permissions

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