Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Prompt for username/password opening PDF

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C - 24 Mar 2008 20:08 GMT
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
George Ter-Saakov - 24 Mar 2008 20:50 GMT
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.

> We have an application that displays the content of a file based on the
> file name suffix, e.g. if "pdf" it uses
[quoted text clipped - 12 lines]
> Thanks.
> David
David C - 24 Mar 2008 21:46 GMT
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
> My guess would be the IIS accounts do not have permission to the file...
>
[quoted text clipped - 27 lines]
>> Thanks.
>> David
George Ter-Saakov - 24 Mar 2008 21:55 GMT
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.

> When you say IIS_USRXXXX are you meaning the IUSR_COMPUTERNAME account?
>
[quoted text clipped - 33 lines]
>>> Thanks.
>>> David
David C - 24 Mar 2008 22:06 GMT
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
> Yes, you right... It must be IUSR_COMUTERNAME and IWAM_COMPUTERNAME.
>
[quoted text clipped - 42 lines]
>>>> Thanks.
>>>> David
George Ter-Saakov - 24 Mar 2008 22:14 GMT
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.

>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
[quoted text clipped - 50 lines]
>>>>> Thanks.
>>>>> David
David C - 24 Mar 2008 23:09 GMT
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
> You might be quietly authenticated using NT Authentication.. hence IIS is
> running under your network account and can access files...
[quoted text clipped - 62 lines]
>>>>>> Thanks.
>>>>>> David

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.