Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2010
    Posts
    417
    Thanks
    4
    Thanked 1 Time in 1 Post

    how to add a download button.

    I have the following code, but wish to allow admin members to download the short WMV video without having the page reload.

    My page can have anything to to 20 videos on the page.

    I can place a button there but how to I get the video files to download and not play when clicked.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Admin</title>
    <link href="style2010.css" rel="stylesheet" type="text/css">
    </head>
    
    <body style="width:1000px; width: 50%; margin-left: auto; margin-right: auto;">
    							<div style="width:1000px; padding-right: 3px; padding-left: 3px; height:100%; min-height: 500px;">
    									<div align="center"><h2>Admin</h2><br /></div>
    									<div style="float: left; padding-left: 5px;">
    									<form name="delete" method="post" action="">
    									<div align="center" style="float: left; padding: 0 10px 50px 10px;">
    									<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="MediaPlayer1" standby="Loading Windows Media Player components..." width="300" height="300">
    											  <PARAM NAME="url" value="67.wmv" />
    											  <param name="src" value="67.wmv" />
    											  <param name="showcontrols" value="true" />
    											  <param name="autostart" value="false" />
    											  <!--[if !IE]>-->
    											  <object type="video/x-ms-wmv" data="67.wmv" width="300" height="300">
    												<param name="src" value="67.wmv" />
    												<param name="autostart" value="false" />
    												<param name="controller" value="true" />
    											  </object>
    											  <!--<![endif]-->
    									</object>
    									<br />67.wmv<br />Delete above file? <input name="67---wmv" type="checkbox" value="delete">
    									</div>
    									<br clear="all"/><input type="submit" name="Delete Selected" value="Delete Selected">
    									</form>
    									<br /><br />
    									</div>
    							</div>
    <br style="clear:both" />
    
    </body>
    </html>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    I can place a button there but how to I get the video files to download and not play when clicked.
    You could add a download link to a page having some server-side script to show the download prompt. Check Example #1 at http://php.net/manual/en/function.header.php to see a PHP snippet.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Aug 2005
    Location
    MS
    Posts
    831
    Thanks
    10
    Thanked 79 Times in 77 Posts
    zip them or...

    Forcing File Downloads in PHP: http://elouai.com/force-download.php
    Using PHP Headers to Force Download: http://www.ryboe.com/tutorials/php-h...force-download
    ☠ ☠RON☠ ☠


  •  

    Posting Permissions

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