473,606 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1228
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.Conten tType = "applicatio n/vnd.ms-excel"
Response.AddHea der("Content-Disposition","a ttachment;filen ame=myfile.xls" );
Response.WriteF ile("c:\MyPriva tePath\myfile.x ls");

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.co m> wrote in message
news:60******** *************** ***@posting.goo gle.com...
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
2466
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 = CreateObject("Scripting.FileSystemObject") set fold = fso.GetFolder(folderspec) for each subfolder in fold.subFolders Response.Write(subfolder.name & "<br>")
2
14418
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
3637
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 locked down except for when a person directly types in the url to a pdf. Currently, the PDFs are in a virtual directory off the root of the server. Putting it under the search site also doesn't work. My understanding is that IIS looks as the...
7
2385
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 this folder as virtual directory in IIS. I know in ASP how to do it. Set objIIS = GetObject("IIS://localhost/W3SVC/1/Root") objIIS.Create("IISWebVirtualDir", strVirtualDirectoryName)
9
6373
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. Virtual directory is £ºhttp://localhost/main Sub-directory is : http://localhost/main/reminder
27
2541
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: Mensaje de error del analizador: We can't load the type 'JULIAN.Global'.
2
978
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 be helpful if i get the steps to do it . expecting the reply soon
11
5779
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 method is to be inherited by all listing classes to allow for * list-wide deletion of latent server-created ZIP files for security purposes *
18
3400
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 dozens of examples of how to authenticate users against Active Directory, but AD seems to be a different animal than Sun Java System Directory Server. Could someone provide me with an example of how to authenticate a user against a Directory...
3
2468
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 program PLESK) to make a directory secure (to access a page in that directory, you have to give a username and a
0
8009
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
7939
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
8432
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...
1
8078
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8299
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
5456
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3919
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
2442
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
1285
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.