/    Sign up×
Community /Pin to ProfileBookmark

download more than one file at a time

I’m looking to find a way to download multiple files at a time. I’ve got my user to a page where they can check multiple boxes and then click the “download these files(s)” button. Now what I’d to happen is that the files all download into some predetermined area (the user will have no choice as to where things get to download to)

I can’t seem to google any kind of script to do this. Does anyone here know of a way to do this? Thanks in advance to all that answer ?

  • sharyn
  • to post a comment
    PHP

    5 Comments(s)

    Copy linkTweet thisAlerts:
    @96turnerriNov 09.2004 — no browser would allow such a security risk
    Copy linkTweet thisAlerts:
    @yunaNov 09.2004 — As an answer to your first question, how about this?

    For generality, we'll assume that all the files can have differing mimetypes, but you have a dictionary someplace that maps file extensions to mimetypes like this:

    [code]
    $mimetypes=array(
    "zip"=>"application/octet-stream",



    ### SEND HEADERS ###
    header("Content-Type: $mimetype");
    header("Content-Disposition: inline; filename=$filename");

    ### NO TEXT CAN BE ECHOED BEFORE HERE ###

    ### Open the file and display it
    $fp=fopen($realname,"r");
    fpassthru($fp);
    Copy linkTweet thisAlerts:
    @yunaNov 09.2004 — PLEASE IGNORE LAST POST

    I wish I could use [tab] in this box! Apparently I accidentally hit tab in the wrong spot, and submitted my unfinished post!

    Here's a better idea.... How about building a zip or gzip archive of the files in the background, then sending the archive? Take a look at http://sourceforge.net/projects/phpziplib for a PKZIP archiving class, or you can use gzencode() to compress into the gzip format.
    Copy linkTweet thisAlerts:
    @sharynauthorNov 16.2004 — 69turnerri,

    This is an all internal app, so actually all I'm going to do is download the files and another app will take over from there and put it where it needs to go. I've decided to use [url=http://www.zend.com/codex.php?id=696&single=1]Zend's zip class[/url] which seems to work great. (thanks for the suggestion Yuna)

    Thanks for your concern and suggestion though.n ?

  • - sharyn
  • Copy linkTweet thisAlerts:
    @96turnerriNov 16.2004 — [i]Originally posted by sharyn [/i]

    [B]69turnerri[/B][/QUOTE]
    96turnerri ? but yeah glad you got it all sorted now ?
    ×

    Success!

    Help @sharyn spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.2,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,
    )...