Download multiple files from a website

Posted on 2007-08-10
Last Modified: 2013-12-13

I am trying to write a script in php that will input a url such as

Which has many files that are availble for download.  Then it will pharse the page and dump the files on my hard drive.  Right now we just have to right click and save each file which for hundreds of files that could take a while.

Basically I know the code to pharse the page and strip the url to the file. But I am not sure of a way to download each url with out it prompting where to save each file.

Question by:fixitben
    LVL 48

    Accepted Solution

    You save the content of those urls like you got that remote page or you use copy;

    copy('', '/local/file/name/localfilename');
    LVL 7

    Author Comment

    That is exactly what I was looking for.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    760 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

    7 Experts available now in Live!

    Get 1:1 Help Now