Results 1 to 11 of 11

Thread: List the contents of a drive

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    List the contents of a drive

    I have been told 'they' want to be able to see the documents on Drive:H

    Is this doable from within a web application project?

  2. #2
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: List the contents of a drive

    Probably depends a lot on how your security was set up on your server.
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: List the contents of a drive

    Quote Originally Posted by SeanGrebey View Post
    Probably depends a lot on how your security was set up on your server.
    As it is a requirement of the specification, I'm assuming the security issues will be dealt with so that the drive can be accessed. It's how you 'find' the drive and list the contents that I am after.

    I like your signature. I spent 20 years as a land surveyor / site engineer / site manager / project manager in the construction industry. 6 day weeks were usual and 7 days was standard for the last 6 months of a project - to get handover on time and avoid liquidated damages.

    Most days sitting here tapping out a bit of code, from home, seems like a doddle - and is quite interesting sometimes!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List the contents of a drive

    Presuming that the security is in place and further presuming that everyone who will ever use this application has a Drive H: mapped to the exact same place, what would you want your documents displayed in?

    Some type of Grid?
    ListView?
    ListBox?
    Dropdown Combo?
    Something else entirely?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: List the contents of a drive

    Quote Originally Posted by Hack View Post
    Presuming that the security is in place and further presuming that everyone who will ever use this application has a Drive H: mapped to the exact same place, what would you want your documents displayed in?

    Some type of Grid?
    ListView?
    ListBox?
    Dropdown Combo?
    Something else entirely?
    The guys who run the network at this place are really switched on - so I'm assuming the team that will use the application will all have a Drive H: mapped to the same place ... they want to be able to access the documents kept there from within the application I am building.

    So, I'm figuring to start with I will list them in a gridview. Unless there is an easy way of creating some sort of directory tree?

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: List the contents of a drive


  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: List the contents of a drive

    Quote Originally Posted by Hack View Post
    Thanks for that ... I was searching using a different expression - and was getting nothing very useful. That 4guysfromrolla article looks good.

  8. #8
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618

    Re: List the contents of a drive

    Quote Originally Posted by Hack View Post
    Presuming that the security is in place and further presuming that everyone who will ever use this application has a Drive H: mapped to the exact same place, what would you want your documents displayed in?

    Some type of Grid?
    ListView?
    ListBox?
    Dropdown Combo?
    Something else entirely?
    Why would you need drive H mapped? If you are trying to look at a Server's H drive, wouldn't whatever account you are running under just need the drive mapped, and then assuming you had permission to it, you should be able to access it in code just using "H:\" wouldn't you?
    Sean

    Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: List the contents of a drive

    That is correct Sean.

    In order to access the files, the Identity of the user who is running the ASP.Net Application Pool for the application, would need to have access. Unless of course you are using Impersonation, but that hasn't been mentioned in this thread.

    In which case, I would actually recommend NOT using a mapped H: drive, instead use the UNC path to the files, and ensure that the Application Pool Identity has the correct permissions to access the files.

    Gary

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    589

    Re: List the contents of a drive

    Quote Originally Posted by gep13 View Post
    That is correct Sean.

    In order to access the files, the Identity of the user who is running the ASP.Net Application Pool for the application, would need to have access. Unless of course you are using Impersonation, but that hasn't been mentioned in this thread.

    In which case, I would actually recommend NOT using a mapped H: drive, instead use the UNC path to the files, and ensure that the Application Pool Identity has the correct permissions to access the files.

    Gary
    Hi Gary

    <authentication mode="windows"> and <identity impersonate="true">

    Cheers

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: List the contents of a drive

    Ah, so you are using impersonation.

    In which case, you will need to make sure that the credentials of the logged in person to your application also has access to the information on the server. In this case, they are still not going to be able to "see" the H: drive, so I would still recommend that you use the UNC path.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width