473,395 Members | 1,368 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,395 software developers and data experts.

Streaming Word-Document Problems

I have a password-protected website with downloads. The
password-protection needed its own login-screen, so I use a
session-object. It works well but now I also want the downloads (PDFs
and Word-Documents) to check if the user is logged-in. When I stream
PDFs, all works well. When I stream DOCs, the Word-File seems broken
when I open it -- a lot of strange characters, some authors
information, and so on.

Can anybody help me?

This is my code ("stmPic" is just a left-over from an online sample...):

response.clear
if inStr(sPath, ".pdf") >= 1 then
Response.ContentType = "application/pdf"
elseif inStr(sPath, ".doc") >= 1 then
Response.ContentType = "application/msword"
Response.AddHeader "content-disposition", _
"attachment; filename=download.doc"
else ' just a fall-back...
Response.ContentType = "application/x"
end if

set stmPic = Server.CreateObject("ADODB.Stream")

stmPic.Open
stmPic.LoadFromFile sPath
stmPic.Type = 1

Response.BinaryWrite stmPic.Read
Response.Flush

stmPic.Close
Jul 19 '05 #1
0 2753

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

Similar topics

7
by: Markus Ernst | last post by:
Hi I know this question is rather HTTP related than PHP, but I did not find an HTTP group on my news server. I deliver some files with the following PHP syntax: header('Content-Description:...
1
by: WildHare | last post by:
What exactly is streaming? When I use a browser or an application and it gets streaming data (say, Headlines, Stock Quotes, etc), what is it really doing. Is it just that the client is constantly...
0
by: Rudy Deitrick | last post by:
I'm displaying a Word doc on the client by streaming HTML to the client and setting the ContentType to 'application/msword'. This works fine on our development server (which does not use SSL), but...
0
by: MS News | last post by:
Hi All, I have a requirement to export asp.net page to Excel and Word. I need to set the default page setup for these documents to Landscape and Fit to page. I followed guidelines from the MS KB...
3
by: A.M-SG | last post by:
Hi, I have a ASP.NET aspx file that needs to pass large images from a network storage to client browser. The requirement is that users cannot have access to the network share. The aspx file...
2
by: mpaliath | last post by:
Hi guys I am currently involved in a project which requires me to recieve and play streaming video as well as send it. In Visual C++ is there any free library which helps me do this as...
8
by: Amjad | last post by:
Hi i am writing a application where i want to browse video file and copy data into stream and send that stream over network...I have develop P2P windows application where i successfully transfer...
2
by: SPG | last post by:
Hi, Two questions for you all.. Firstly, is there a way of streaming video using PHP? At the moment I just have a link to a video file and the whole thing downloads before playing which is a...
8
by: Tony K | last post by:
Is streaming audio capable in asp.net 2.0 / AJAX? What I mean by streaming audio is: ability to play one or more songs back to back...or maybe even let the user select several songs to play and it...
5
by: pmakoi | last post by:
dear all this might be a piece of cake for some of you out there but it is causing me a lot of stress given the fact that there is not enogh documentation out there regarding this topic I am...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.