Home All Groups Group Topic Archive Search About
Author
19 Jun 2009 5:16 PM
DavidS
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.

Author
19 Jun 2009 5:34 PM
Patrice
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.
Are all your drivers up to date? click for free checkup

Author
19 Jun 2009 5:42 PM
DavidS
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.
>
>
Author
21 Jun 2009 5:08 PM
Daniel Ulfe
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.
>>
Author
23 Jun 2009 10:04 AM
Patrice
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.
>>
>>
Author
22 Jun 2009 9:11 AM
Andrew Morton
DavidS wrote:
> 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" )

The overload you need is
Directory.GetFiles("H:\", "*.pdf")

You can't specify a wildcard in the directory name.

Andrew

Bookmark and Share