Prompt for username/password opening PDF

D

David C

We have an application that displays the content of a file based on the file
name suffix, e.g. if "pdf" it uses
Response.ContentType = "application/pdf"

and then to display it it uses

Response.WriteFile(FilePath)

and it works fine for all but very large files. For very large files (e.g.
a 5MB file) it pops up a prompt for username and password for the domain and
I can't figure out why. Does any one know how I can solve this or where to
look? The application is NT Authority only intranet site. Smaller files
are not a problem.

Thanks.
David
 
G

George Ter-Saakov

My guess would be the IIS accounts do not have permission to the file...

what I say here is just a guess and not confirmed or read anywhere...

***************
For small files .NET handles Response.WriteFile itself.... reads file and
sends it over to browser so only ASP.NET account needs to have read
permissions...

For big files .NET asks IIS do it (there is an API in ISAPI to do so)...
hence IIS_USRXXXX account needs to be able to read that file...
************************


George.
 
D

David C

When you say IIS_USRXXXX are you meaning the IUSR_COMPUTERNAME account?

Not sure if this helps, but users can open the file just fine from Windows
Explorer.

David
 
G

George Ter-Saakov

Yes, you right... It must be IUSR_COMUTERNAME and IWAM_COMPUTERNAME.

Does not matter that user can open from Windows Explorer. Those 2 accounts
IIS is running under (by default)... When it can not open files then it
sends back prompt for username/password trying to authenticate user and
access files under his account.

George.
 
D

David C

I checked my setup here and I do not have any permissions set for either of
those accounts but I can open files fine. However, at our customer site
they have the problem with large files. These files are opened from a
virtual directory that is part of the web site. Would that be where the
permissions are needed and not in the actual file system itself? Thanks.

David
 
G

George Ter-Saakov

You might be quietly authenticated using NT Authentication.. hence IIS is
running under your network account and can access files...

Your customer though can not be quietly authenticated since most likely they
do not sit on your network and not part of the domain... Hence the prompt.

You can test it by unchecking "NT Authentication" in IIS Managmen console
and leaving only "Anonymous" and see if you start getting the prompt...

George.
 
D

David C

I'm sorry, I forgot to tell you that the customer is on their own
servers/domain and they are getting the prompt for their domain, not ours.
Sorry if I wasn't clear. We developed the site for them and they are
getting the prompt at their site but we do not get prompted at our site.

The web is "NT Authentication" only so we cannot (and do not want to) check
the anonymous user as we read their login name from the network. If I add
anonymous then I cannot read their login name.

David
 
M

Monique

I just reinstalled IIS as I worked with wamp before and yet I didn't find out
how to have a php and a asp server working the same time on a computer. (I
had to uninstall the IIS to get wamp at work). But my question now is only
about asp. Everything works in asp only that there comes a popup that ask
for username and password. I searched what could be meant and saw you use
the terminology "IUSR_COMUTERNAME and IWAM_COMPUTERNAME".
I tried this out for my pc name but without succes and in fact I don't know
where to get the password. Please do you have any suggestion to solve the
logging in problem? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top