|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GetFiles, DeleteI want the server page to remove PDF files created at an earlier stage by a
web page. I'm always receiving a misleading error message - "illegal character in path", etc..., "missing character" - when I attempt to use Directory.GetFiles( ... ). For example: Directory.GetFiles( "H:\*.PDF" ) It truly appears to be security issue when attempting to access the local share for user. I've attempted to impersonate - even as the ADMINISTRATOR - and still failes. I've extended security permissions for the IIS process on the local share - read/write/all. Nothing works. Does the GetFiles(...) function work for an IIS process when accessing a local share? If so / any examples - or what am I missing. Could it be that this is initiated only if an interactive session is opened
etc... For some kinds of things you run into this. Can't you use an UNC share ? (i.e. \\myserver\share etc...). This is what I (and likemy most of us) are always using... See : http://support.microsoft.com/kb/180362/EN-US/ -- Patrice "DavidS" <Dav***@discussions.microsoft.com> a écrit dans le message de groupe de discussion : 9BC25A36-575E-4545-A1AC-941F5FB14***@microsoft.com...Show quoteHide quote > I want the server page to remove PDF files created at an earlier stage by > a > web page. > > I'm always receiving a misleading error message - "illegal character in > path", etc..., "missing character" - when I attempt to use > Directory.GetFiles( ... ). > > For example: Directory.GetFiles( "H:\*.PDF" ) > > It truly appears to be security issue when attempting to access the local > share for user. > > I've attempted to impersonate - even as the ADMINISTRATOR - and still > failes. I've extended security permissions for the IIS process on the > local > share - read/write/all. > > Nothing works. Does the GetFiles(...) function work for an IIS process > when > accessing a local share? If so / any examples - or what am I missing. I do use a UNC, i.e., \\FileServ\Users\<<login name for user>> || For
example... \\FileServ\Users\DUser - where DUser is folder for user name DUser. I receive "unknown user name or bad permission". Again - the remote share I'm not able to read or delete files from. Can you suggest a way to do this? Show quoteHide quote "Patrice" wrote: > Could it be that this is initiated only if an interactive session is opened > etc... For some kinds of things you run into this. > > Can't you use an UNC share ? (i.e. \\myserver\share etc...). This is what I > (and likemy most of us) are always using... > > See : > > http://support.microsoft.com/kb/180362/EN-US/ > > -- > Patrice > > "DavidS" <Dav***@discussions.microsoft.com> a crit dans le message de > groupe de discussion : 9BC25A36-575E-4545-A1AC-941F5FB14***@microsoft.com... > > I want the server page to remove PDF files created at an earlier stage by > > a > > web page. > > > > I'm always receiving a misleading error message - "illegal character in > > path", etc..., "missing character" - when I attempt to use > > Directory.GetFiles( ... ). > > > > For example: Directory.GetFiles( "H:\*.PDF" ) > > > > It truly appears to be security issue when attempting to access the local > > share for user. > > > > I've attempted to impersonate - even as the ADMINISTRATOR - and still > > failes. I've extended security permissions for the IIS process on the > > local > > share - read/write/all. > > > > Nothing works. Does the GetFiles(...) function work for an IIS process > > when > > accessing a local share? If so / any examples - or what am I missing. > > FYI... if you are using "GetFiles" in a IIS Application (website)...
then you need to add the "user" "NETWORK SERVICES" to that share folder (In a W2003 server).... a IIS Process uses that user instead of the local user. Daniel. DavidS wrote: Show quoteHide quote > I do use a UNC, i.e., \\FileServ\Users\<<login name for user>> || For > example... > \\FileServ\Users\DUser - where DUser is folder for user name DUser. > > I receive "unknown user name or bad permission". Again - the remote share > I'm not able to read or delete files from. Can you suggest a way to do this? > > "Patrice" wrote: > >> Could it be that this is initiated only if an interactive session is opened >> etc... For some kinds of things you run into this. >> >> Can't you use an UNC share ? (i.e. \\myserver\share etc...). This is what I >> (and likemy most of us) are always using... >> >> See : >> >> http://support.microsoft.com/kb/180362/EN-US/ >> >> -- >> Patrice >> >> "DavidS" <Dav***@discussions.microsoft.com> a crit dans le message de >> groupe de discussion : 9BC25A36-575E-4545-A1AC-941F5FB14***@microsoft.com... >>> I want the server page to remove PDF files created at an earlier stage by >>> a >>> web page. >>> >>> I'm always receiving a misleading error message - "illegal character in >>> path", etc..., "missing character" - when I attempt to use >>> Directory.GetFiles( ... ). >>> >>> For example: Directory.GetFiles( "H:\*.PDF" ) >>> >>> It truly appears to be security issue when attempting to access the local >>> share for user. >>> >>> I've attempted to impersonate - even as the ADMINISTRATOR - and still >>> failes. I've extended security permissions for the IIS process on the >>> local >>> share - read/write/all. >>> >>> Nothing works. Does the GetFiles(...) function work for an IIS process >>> when >>> accessing a local share? If so / any examples - or what am I missing. >> Sorry, the sample code you shown was using the H: letter ? Plus you talked
about different messages such as "illegal character in path", etc..., "missing character".... Assuming these issues are now solved, it would left us with security settings. Have you granted the appropriate rights to *both* the share itself and the filesystem. You need to grant rights to both... If yes to which account ? Under IIS6, ASP.NET runs by default under NETWORK SERVICE which is automatically shown as MACHINENAME$ for network requests... If it still fails a tool such as filemon (www.sysinternals.com) allows to track file access and see what it fails... (the message seems a bit strange especially the unknown user name, it should be such as securiry exception). -- Patrice "DavidS" <Dav***@discussions.microsoft.com> a écrit dans le message de groupe de discussion : DAEC88F1-A33D-4A5B-B010-BB256BBA7***@microsoft.com...Show quoteHide quote > I do use a UNC, i.e., \\FileServ\Users\<<login name for user>> || For > example... > \\FileServ\Users\DUser - where DUser is folder for user name DUser. > > I receive "unknown user name or bad permission". Again - the remote share > I'm not able to read or delete files from. Can you suggest a way to do > this? > > "Patrice" wrote: > >> Could it be that this is initiated only if an interactive session is >> opened >> etc... For some kinds of things you run into this. >> >> Can't you use an UNC share ? (i.e. \\myserver\share etc...). This is what >> I >> (and likemy most of us) are always using... >> >> See : >> >> http://support.microsoft.com/kb/180362/EN-US/ >> >> -- >> Patrice >> >> "DavidS" <Dav***@discussions.microsoft.com> a crit dans le message de >> groupe de discussion : >> 9BC25A36-575E-4545-A1AC-941F5FB14***@microsoft.com... >> > I want the server page to remove PDF files created at an earlier stage >> > by >> > a >> > web page. >> > >> > I'm always receiving a misleading error message - "illegal character in >> > path", etc..., "missing character" - when I attempt to use >> > Directory.GetFiles( ... ). >> > >> > For example: Directory.GetFiles( "H:\*.PDF" ) >> > >> > It truly appears to be security issue when attempting to access the >> > local >> > share for user. >> > >> > I've attempted to impersonate - even as the ADMINISTRATOR - and still >> > failes. I've extended security permissions for the IIS process on the >> > local >> > share - read/write/all. >> > >> > Nothing works. Does the GetFiles(...) function work for an IIS process >> > when >> > accessing a local share? If so / any examples - or what am I missing. >> >> DavidS wrote:
> I want the server page to remove PDF files created at an earlier The overload you need is> stage by a web page. > > I'm always receiving a misleading error message - "illegal character > in path", etc..., "missing character" - when I attempt to use > Directory.GetFiles( ... ). > > For example: Directory.GetFiles( "H:\*.PDF" ) Directory.GetFiles("H:\", "*.pdf") You can't specify a wildcard in the directory name. Andrew
Other interesting topics
|
|||||||||||||||||||||||