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

ASP.NET File Server Issue

hb
I am having trouble with creating a document server from a database using
asp.net.
It works on the development machine (win2k, iis5.0), but fails on the
production server (win2003, iis6.0).
The production server is not failing in all circumstances, however. The
behavior has the following characteristics:

1) serving of gif and jpg files work fine on both machines
2) serving of pdf files works on:
a) the development server through http - always (client on dev server or
another machine)
b) the production server when sent via http
c) the production server through https when the client is also run on
the production server
and fails on:
a) the production server when sent via https

In the failing cases, the client gets a dialog box with the following
message:
Acrobat could not open 'xxx.fdf' because it is either
not a supported file type or because the file has been
corrupted (for example it was sent as an e-mail
attachment and wasn't properly decoded).

I find it strange that pdf says 'xxx.fdf' rather than 'xxx.pdf'. That is
not a typo. It is not an error in the document server either since the code
is the same when it works and when it doesn't work.

After reading some of the comments on the forum, from people with similar
questions, I tried increasing the expiration from "immediate" to 5 minutes.
I've also increased the page timeout setting to 90 seconds though this
document is small enough to be sent in well under 10 seconds.

The pertinent code is as follows:

Response.Clear();
Response.ContentType = "application/pdf"; // note this
is image/gif or image/jpg for the other formats
Response.AppendHeader("Content-Length", ""+docSize);
Response.AppendHeader("Content-Disposition", "inline;
filename="+docName); // note, tried it with/without "inline; " inculded
it didn't have an observable effect.
Response.BinaryWrite(doc);
Response.End();

All suggestions welcome.

hb
Nov 18 '05 #1
4 2923
hb
New info, the server works, but apparently only from machines without adobe
acrobat professional (the acrobat creater, not just the reader version)
installed.
Is there an issue with file associations or something like that? Why would
it on
machines with the adobe professional through http, but not https?
I am having trouble with creating a document server from a database using
asp.net.
It works on the development machine (win2k, iis5.0), but fails on the
production server (win2003, iis6.0).
The production server is not failing in all circumstances, however. The
behavior has the following characteristics:

1) serving of gif and jpg files work fine on both machines
2) serving of pdf files works on:
a) the development server through http - always (client on dev server or another machine)
b) the production server when sent via http
c) the production server through https when the client is also run on
the production server
and fails on:
a) the production server when sent via https

In the failing cases, the client gets a dialog box with the following
message:
Acrobat could not open 'xxx.fdf' because it is either
not a supported file type or because the file has been
corrupted (for example it was sent as an e-mail
attachment and wasn't properly decoded).

I find it strange that pdf says 'xxx.fdf' rather than 'xxx.pdf'. That is
not a typo. It is not an error in the document server either since the code is the same when it works and when it doesn't work.

After reading some of the comments on the forum, from people with similar
questions, I tried increasing the expiration from "immediate" to 5 minutes. I've also increased the page timeout setting to 90 seconds though this
document is small enough to be sent in well under 10 seconds.

The pertinent code is as follows:

Response.Clear();
Response.ContentType = "application/pdf"; // note this is image/gif or image/jpg for the other formats
Response.AppendHeader("Content-Length", ""+docSize);
Response.AppendHeader("Content-Disposition", "inline;
filename="+docName); // note, tried it with/without "inline; " inculded
it didn't have an observable effect.
Response.BinaryWrite(doc);
Response.End();

All suggestions welcome.

hb

Nov 18 '05 #2
hb,

how large is that PDF file? If it is a very large file (> 100 MB), try this
KB article:
http://support.microsoft.com/default.aspx?kbid=823409

It introduces a new method, Response.TransmitFile (which is included in the
hotfix mentioned, but is also part of the .NET Framework 1.1 Service Pack 1).
That method solved all my downloading problems.
On the other hand, the HTTPS part sounds more suspicious. Are your
certificates installed correctly?

Al

Nov 18 '05 #3
hb
Thanks al,

In the current case, this is probably not the issue since the
file is only 130KB (tiny) my server is slow (128 or 256 dsl).
Though i will switch to this because future files may be larger
(hopefully not before my connection is upgraded;).

The certificates appear to be in place (clients show the lock
and the certificates can be reviewed on the client) and the
general functionality of the web site appears solid (6 months
in production).

Any more suggestions? Anyone?
"Alexander" <Al*******@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
hb,

how large is that PDF file? If it is a very large file (> 100 MB), try this KB article:
http://support.microsoft.com/default.aspx?kbid=823409

It introduces a new method, Response.TransmitFile (which is included in the hotfix mentioned, but is also part of the .NET Framework 1.1 Service Pack 1). That method solved all my downloading problems.
On the other hand, the HTTPS part sounds more suspicious. Are your
certificates installed correctly?

Al


Nov 18 '05 #4
hb
Thanks for your help. A hint from adobe's forum's pointed me to this:

http://support.microsoft.com/default...;en-us;Q293792

The design of the web page was that such that user is redirected from
other pages that list the files to be opened. The file sent is passed
through session variables which are read and cleared in the Page_Load.
I'm guessing its a matter of speed. HTTP is quicker than HTTPS which
has the added burden of encryption.

Delaying the deletion of the session variables appears to resolve this
issue.

Does the HTTP vs HTTPS thing sound too far fetched?
"hb" <h@h.com> wrote in message news:jun8d.122362$wV.49418@attbi_s54...
I am having trouble with creating a document server from a database using
asp.net.
It works on the development machine (win2k, iis5.0), but fails on the
production server (win2003, iis6.0).
The production server is not failing in all circumstances, however. The
behavior has the following characteristics:

1) serving of gif and jpg files work fine on both machines
2) serving of pdf files works on:
a) the development server through http - always (client on dev server or another machine)
b) the production server when sent via http
c) the production server through https when the client is also run on
the production server
and fails on:
a) the production server when sent via https

In the failing cases, the client gets a dialog box with the following
message:
Acrobat could not open 'xxx.fdf' because it is either
not a supported file type or because the file has been
corrupted (for example it was sent as an e-mail
attachment and wasn't properly decoded).

I find it strange that pdf says 'xxx.fdf' rather than 'xxx.pdf'. That is
not a typo. It is not an error in the document server either since the code is the same when it works and when it doesn't work.

After reading some of the comments on the forum, from people with similar
questions, I tried increasing the expiration from "immediate" to 5 minutes. I've also increased the page timeout setting to 90 seconds though this
document is small enough to be sent in well under 10 seconds.

The pertinent code is as follows:

Response.Clear();
Response.ContentType = "application/pdf"; // note this is image/gif or image/jpg for the other formats
Response.AppendHeader("Content-Length", ""+docSize);
Response.AppendHeader("Content-Disposition", "inline;
filename="+docName); // note, tried it with/without "inline; " inculded
it didn't have an observable effect.
Response.BinaryWrite(doc);
Response.End();

All suggestions welcome.

hb

Nov 18 '05 #5

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

Similar topics

7
by: Nik Coughin | last post by:
Is there a simple way of opening a text file from a server, and reading from it line by line? IE http://someserver/file.txt contains a couple of hundred lines. Each line is the name of a...
4
by: Mick | last post by:
Anyone know of any problems with this??? Using it to upload image files to a server. Most of the files work fine but occasionally one causes error with fopen() on server. Seems the...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
14
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the...
1
by: Matt Hamilton | last post by:
I was hoping that someone can give me step-by-step instructions to fix the following: We would like our ASP.NET application to utilize a central file server for uploads and downloads. I have...
3
by: J055 | last post by:
Hi How do I tell the user he has tried to upload a file which is too big... 1. when the httpRuntime.maxRequestLength has been exceeded and 2. when the uploaded file is under then...
18
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that...
8
by: rdemyan via AccessMonster.com | last post by:
Anyone have any ideas on how to determine when the back-end file (containing only tables) has been updated with new data. The date/time of the file won't work because it gets updated to the...
10
by: Redhairs | last post by:
In a web farm environment, how to store the user uploading files for future access? Store them in db, local file system or centralized file server? If trying to storing the file in local file...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.