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

Directory Access

I have a site in asp.net. In that site I have a directory full of
excel spreadsheets. When a user logs in it points them to the
spreadsheet that I want them to see. However, if they then exit out
and go directly to the link it still re-opens the spreadsheet.

Here's what I am asking. How can I setup the spreadsheets/directory
so that you have to have logged in for the server to allow you into
the directory.

Here's the geek speak:

They login to http://www.site.com/login.aspx

That takes them to http://www.site.com/filelist.aspx where they can
open a spreadsheet located at
http://www.site.com/excel/specificfile.xls.

So how can I keep them from going to
http://www.site.com/excel/specificfile.xls without going through
http://www.site.com/login.aspx first?

Len
Nov 18 '05 #1
1 1220
Put the spreadsheets in a private directory that cannot be directly accessed
from the web.
Then use some code similar to this:
Response.Clear();
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("Content-Disposition","attachment;filename=myfile.xls");
Response.WriteFile("c:\MyPrivatePath\myfile.xls");

Here's more info:
http://msdn.microsoft.com/library/de...efiletopic.asp
http://www.aspnetpro.com/NewsletterA...200309so_l.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Len Svitenko" <it******************@yahoo.com> wrote in message
news:60**************************@posting.google.c om...
I have a site in asp.net. In that site I have a directory full of
excel spreadsheets. When a user logs in it points them to the
spreadsheet that I want them to see. However, if they then exit out
and go directly to the link it still re-opens the spreadsheet.

Here's what I am asking. How can I setup the spreadsheets/directory
so that you have to have logged in for the server to allow you into
the directory.

Here's the geek speak:

They login to http://www.site.com/login.aspx

That takes them to http://www.site.com/filelist.aspx where they can
open a spreadsheet located at
http://www.site.com/excel/specificfile.xls.

So how can I keep them from going to
http://www.site.com/excel/specificfile.xls without going through
http://www.site.com/login.aspx first?

Len

Nov 18 '05 #2

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

Similar topics

26
by: Dan Nash | last post by:
Hi guys I have a page that is *supposed* to list the directories on the server. Here's the code... folderspec = server.MapPath("./images/") set fso =...
2
by: Jacky Luk | last post by:
Hi all, If I need to make a C# application, do I need to set up a virtual dir such as inetroot on the Harddisks. How do I set up such thingy? Thanks Jack
10
by: Wm. Scott Miller | last post by:
We have a intranet site that allows one of our departments to search a set of pdfs and then look at them. Only problem is that only they and us geeks should be allowed to see the pdfs. We have it...
7
by: Jaydeep | last post by:
Hi, Anybody knows how to create virtual directory programmatically under root directory ofcourse from code-behind. I am developing web-based application where I need to create a folder and making...
9
by: Benny Ng | last post by:
Hi,all, How to let the sub-directory to avoid the authentication control from Root's webconfig? I heard that we can add a new web.config to the sub-directory. And then we can slove the problem....
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
2
by: anand | last post by:
When create a new directory on a remote machine it works when impersonate="true" credential is given . Is there any other method that a proper access can be given to create a directory . iT would...
11
by: comp.lang.php | last post by:
Once again, I thought my class method deleteZip() would do the trick, but it never deletes any .zip* file found in a directory: /** * Delete any latent ZIP files found in this album. This...
18
by: troywalker | last post by:
I am new to LDAP and Directory Services, and I have a project that requires me to authenticate users against a Sun Java System Directory Server in order to access the application. I have found...
3
by: Charlotte | last post by:
Hello, info: I'me a rookie with IIS I have on a WinXP Pro the IIS installed, so I can test some pages before uploading to the hostserver online on the hostserver is a possibility (with the...
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
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
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
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...
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...
0
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...
0
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,...

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.