Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Savings MPEGs from a website

Status
Not open for further replies.

ml23sh

Programmer
Jul 13, 2001
11
US
I have a site that populates with people from a databasae. Each person has several MPEGs associated with them. next to each MPEG there is a checkbox. Clicking in the checkbox will invoke a "SaveAs" box to pop up. The only choices are to save the file as .htm or .txt. Is there anyway to tweak the document.execCommand('SaveAs') command to include mpegs?
Thanks for your help!

-Matt
 
The execCommand() is only used at the document level. The reason you can only choose between .txt and .html is becuase it is asking you to save the document(Page) and not the link or it's contents.


Look into ActiveXObject methods for this capability, or just download the Gozilla.com download manager and set it to download file types of MPEG's.

Or put all of the MPEG's into Zip files, that way they will get a save as command when clicking the URL and there's no code to process. Rocco is the BOY!!

M O T I V A T E!
 
You could invoke the download dialog by sending the right document headers (with php or perl).

By the way, could you post your code that invokes the save as dialog?? I have been on the look out for that for a while now! -gerrygerry
Go To
 
Here's the code that you wanted...hope it helps!
-Matt

function saveAsMpeg (filename)
{
document.execCommand('SaveAs',null,filename)
}

<html>

<INPUT type=&quot;checkbox&quot; name=&quot;list&quot; value=1 onClick=&quot;saveAsMpeg('MyFile.html')&quot;>

</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top