Visual Basic (3539)
How can I start two simultaneous downloads with one link?
2 comments. Current rating: (1 votes). Leave comments and/ or rate it.
Question:I need to ensure that a user downloads two files and want to start both downloads once the user has clicked on 'Download now'. I cannot pack both files in one archive. How can I achieve this?
Answer:This is a good application for IFRAMEs. (Or regular FRAMEs). Have one (I)FRAME for each document and write a function that sets each frame's location to one of the downloads.
If you want to go fancy, you can even create those IFRAMEs dynamically on the fly with insertAdjacentHTML and setting their SRC parameter to each file's URL.
Otherwise simply provide the two IFRAMEs somewhere small and not noticable at the bottom of the page and dynamically set their SRC attribute.