download features

This is a discussion on "download features" within the Flash & Multimedia Forum section. This forum, and the thread "download features are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #21 (permalink)  
Old May 7th, 2004, 19:32
Junior Member
Join Date: Apr 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
I was in my MIME type settings, and it won't allow me to make it 'invalid'. I tried download/PFD, text/PDF, load/PDF, transfer/PDF, and the PDF file still opens in my browser. Hmmm, i'll take that ASP code from ya if it's cool? I'll fiddle with that for a bit. Thanks.
  #22 (permalink)  
Old May 10th, 2004, 09:12
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
either pass the name of the pdf file to the script on the querystring or change the strFileName variable directly.

Code: Select all
<%
Response.Buffer = True
strFileName=Request.QueryString
strFilePath=server.mappath("downloads/"&strFilename)
set fso=createobject("scripting.filesystemobject")
set f=fso.getfile(strfilepath)
strFileSize = f.size
set f=nothing: set fso=nothing
Const adTypeBinary = 1
Response.Clear
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
strFileType = "bad/type" ' change to the correct content type for your file
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFileName
Response.AddHeader "Content-Length", strFileSize
Response.Charset = "UTF-8"
Response.ContentType = strFileType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
%>
Closed Thread

Tags
download, features

« Beginner | play »
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download button - to download a PDF file attila001122 Web Page Design 4 Aug 15th, 2008 11:44
HTML 4 Deprecated Features chetan1 Web Page Design 1 May 13th, 2008 11:53
what features Hunter Hosting & Domains 12 Dec 5th, 2007 13:58
More new features planned! Rob Announcements and News 0 Dec 15th, 2006 22:23
One Log-In Different Features... courtjester Classic ASP 7 Jul 26th, 2004 19:54


All times are GMT. The time now is 10:03.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43