473,609 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Conten tType = "applicatio n/pdf"
elseif inStr(sPath, ".doc") >= 1 then
Response.Conten tType = "applicatio n/msword"
Response.AddHea der "content-disposition", _
"attachment ; filename=downlo ad.doc"
else ' just a fall-back...
Response.Conten tType = "applicatio n/x"
end if

set stmPic = Server.CreateOb ject("ADODB.Str eam")

stmPic.Open
stmPic.LoadFrom File sPath
stmPic.Type = 1

Response.Binary Write stmPic.Read
Response.Flush

stmPic.Close
Jul 19 '05 #1
0 2761

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

Similar topics

7
5440
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: File Transfer'); header('Content-Type: '.$mimetype); header('Content-Length: '.filesize($file));
1
1445
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 making new requests for information from a given web server, or is there more magic to it? It sounds like we are opening a connection and getting a constant "stream" of information...is this the case, or is it just an illusion. If it really...
0
903
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 our test server (which DOES USE SSL) will not display the header and footer on the word doc. I would like to know if anyone knows if SSL could be the problem with the headers and footers not displaying. Thanks, Rudy Deitrick
0
1176
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 article "How To Format an Excel Workbook While Streaming MIME Content"(http://support.microsoft.com/kb/271572/EN-US/) to be able to successfully set Landscape orientation in Excel,how ever the "Fit To Page" xml directive is not working. Also I...
3
2329
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 must be the only method that users receive image files.
2
9748
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 'streaming' is not part of the actual project, i am allowed to use external libraries. Also could anyone tell me where I can learn about video streaming in c++ so I can code the streaming part myself too thx
8
65818
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 text message to each other but now i want to send video file and play that file on other end...I know the code how to send the stream over the network but basic problem is how open that file as a stream. Thanks
2
8432
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 bit of a chore as the video file is pretty huge. Secondly, I want to restrict access to the video using a password. Can anyone think of a nice way of doing this? I thought about having the video
8
3091
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 will play them back to back. Thanks, Tony K
5
3539
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 writing a web service that uses soap with attachments to send a large streaming data, The concept works quite well but when I started to test it I got this problem. When my client program calls a method that should return a real time data the...
0
8129
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8074
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8404
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6997
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6056
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4017
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2530
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1386
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.