PDA

View Full Version : HTML question



nn_step
05-13-2006, 11:46 AM
I have very little HTML experience, ZERO training and the like but I have a question.
Is it possible to create a batch file in HTML so that a single click and download for the end user would download a set of files.

Qkjhfhaiguihfma
05-13-2006, 06:38 PM
zip the files

nn_step
05-13-2006, 06:40 PM
Not an option

Heretic
05-14-2006, 05:16 AM
I'm not exactly sure what you're trying to do, but perhaps this (http://www.motobit.com/tips/detpg_multiple-files-one-request/) will help

wwwww
05-28-2006, 07:37 PM
Not sure if it'll work but something like

<script>
function wang(){
window.open("potatoandgravy.exe");
window.open("greeneggsandham.avi");
window.open("marypoppinsinbluejeans.exe");
window.open("hello.jpg"); //who knows what this is? :P
//etc
}
</script>

and for your link put the href to be "javascript:wang();"

eg:

<a href="javascript:wang();">Fun and games for your children</a>

That should work - haven't tested it though. May have gotten the case wrong in window and open. (haven't played with js in years).


I'm not exactly sure what you're trying to do, but perhaps this (http://www.motobit.com/tips/detpg_multiple-files-one-request/) will help

That's in vb on the server side.

Entity_Razer
06-01-2006, 01:03 AM
see above for answer :)

btw if you set <script type="text/javascript" href="bla.js">
SCRIPT HERE
</script>

you don't need to set "javascript:wang();" just
onclick="wang();"
or href="wang();"

normally the browser recognizes the fact that your calling a function from javascript

wildcard
06-02-2006, 01:24 PM
Would that result in 4 different download windows? If you are looking to do it without seperate download windows, a self-extracting archive might be the best way to do it.

nn_step
06-02-2006, 01:30 PM
Would that result in 4 different download windows? If you are looking to do it without seperate download windows, a self-extracting archive might be the best way to do it.
Actually yes that would open up a bunch of windows each downloading one part.. but the problem is how to upload the parts and get it to download in one piece...

wildcard
06-02-2006, 07:26 PM
Most browsers / firewalls/ AV / OS's / etc. have built in "security" mechanisms that prevent that sort of thing from happening (ie: doing something the user didnt *explicitly* ask for).

Why don't you give us more details as to what you are doing and perhaps we can offer some alternatives.

StrikeRTM
06-26-2006, 01:10 PM
It is possible to upload data and then launch a program that zips or rars them or more likely - Tgz's them into an archive, then adds the downlaod link to a database.

Let's imagine, for a moment, that we have those files uploaded and we have a javascript that can encode or unite all the data that the user wishes to download(your example of 4 files). Now, how exactly the user will seperate files if they came as one in the download? Is it even practical? The user would require a program on his side to get the files seperated again, woudn't he?

Another approach is to unite the files using php on server side and transfer to the user, then when the transfer is finished, the javasceipt that is in the download page would seperate the files on client side, but it is not as easy as it sounds, it's actualy very hard or more time consuming to make rather than hard.

I suggest you find another, better way or use a program to on server side to put the upload files into archives and then put the links into the database. I think it's the more practical and simpler approach.