473,413 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

asp force download

Dear Sir,

I made a force download in ASP. For other types of file, everything works
ok. but for .txt, .html this kind of file. it always return an error, file
not found. can someone point out what I did wrong here?

The following is my script

strContentType = "application/octet-stream"
abcFile = "filename="&objRs("DocumentName")

response.AddHeader "Content-Disposition", abcFile
response.contenttype=strContentType
response.binarywrite getBinaryFile(FileName)

function getBinaryFile(fileSpec)
Dim adTypeBinary
adTypeBinary = 1
Dim oStream
set oStream = server.createobject("ADODB.Stream")
oStream.Open
oStream.Type = adTypeBinary
oStream.LoadFromFile fileSpec
getBinaryFile= oStream.read
set oStream=nothing
end function
--
Met vriendelijke groet,

Guoqi Zheng
Tel: +31 (0) 23 5343545
http://www.meetholland.com
Jul 19 '05 #1
2 1515

"Guoqi Zheng" <no@sorry.com> wrote in message
news:ug**************@tk2msftngp13.phx.gbl...
Dear Sir,

I made a force download in ASP. For other types of file, everything works
ok. but for .txt, .html this kind of file. it always return an error, file
not found. can someone point out what I did wrong here?


What error? And I think you should be returning those file types as
"adTypeText" (2).

Ray at home
Jul 19 '05 #2
The error I got is "page not found", I don't really understand it. I will
try to test by adTypeText
Thanks

"Ray at <%=sLocation%>" <myFirstNameATlane34dotKOMM> wrote in message
news:#S**************@TK2MSFTNGP12.phx.gbl...

"Guoqi Zheng" <no@sorry.com> wrote in message
news:ug**************@tk2msftngp13.phx.gbl...
Dear Sir,

I made a force download in ASP. For other types of file, everything works ok. but for .txt, .html this kind of file. it always return an error, file not found. can someone point out what I did wrong here?


What error? And I think you should be returning those file types as
"adTypeText" (2).

Ray at home

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matthew Sims | last post by:
Is it possible to force a download without using the readfile function? My website setup consists of my server that serves the web pages plus a high-speed file server elsewhere on the internet...
2
by: Jonathan Driller | last post by:
I am attempting to block repeat downloads from a site. I need to have a landing page pass a referer to a secured page. I have tried a meta refresh redirect and several Javascript redirect...
0
by: Jake | last post by:
How can I force an image download with IE using ASP.net?? Here is the catch: the image I want to force a write with is located on another web server. I can only reference the image with a URL. ...
2
by: JP SIngh | last post by:
Hi All I am creating an asp application which is essentially a file management app. I am trying to get my head around a technically issue wonder if someone can offer some help. I want to be...
4
by: Kevin Muenzler, WB5RUE | last post by:
How do I force a browser to download a file instead of displaying it? In other words I have a page with MP3 and WMA files on it and I would like for the visitor to download the file instead of...
4
by: tma | last post by:
Short of zipping my file, are there any other alternatives to the below? I'm trying to add anchors in code and I need the link to force a download of the .pdf rather than open a new window or...
0
by: comp.lang.php | last post by:
I have a form that when you click the "Generate Report" submit button, it will force download a CSV file, required for this project. On the very same page you also have a "Search" submit button,...
2
by: comp.lang.php | last post by:
class ReportGenerator { function ReportGenerator() {} /** * Generate the HTTP headers necessary for this file type. Can be called statically *
3
by: Bouffa | last post by:
Hello everyone, I suppose you all know force-download scripts. The problem is that these scripts don't allow files to be splitted when downloading them via a download manager. I've found a...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.