Mapped drives are stored per user profile. The account that ASP.NET is
running under doesn't have the drives mapped. You would have to use a UNC
path to the drive.
I would, however, question what you are doing. Web applications moving
files about on a corporate network has some serious security implications ...
and your web applications would need to have permissions on other machines on
the network. This presents a significant amount of risk, especially if the
web site is public-facing. There are less risky ways to accomplish what you
need to do without having the web application directly writing files across
the network.
[quoted text, click to view] "Eje" wrote:
> I have a webapplication on a server. One function is to
> build txt-files. These files should then be moved to a
> fixed directory on another computer in the company
> network.
>
> I have tried to use System.IO.File.Move but get the
> message "Could not find a part of the path". The path to
> the receiving directory is mapped.
>
> I get the same message independant of receiving computer
> and independant of which command I try under System.IO. I
> have no problem to move the files to another location on
> the server.
>
> With Explorer I have full access to the directories.
>
> Does anyone have a solution how to move the files?
>
> Eje
Thanks for your answer.
In this case the files are extracts from the SQL Server.
Finally they will be xls-files but I found it difficult
to make the DTS function just by pressing a button on a
webpage. Instead I thought I could produce txt-files with
delimiter and send to the another (but just one) server
in the network for later import to Excel. Today the
application is not public but the intention is to make it
public in the future.
Do you have a suggestion how to solve this problem?
Eje
[quoted text, click to view] >-----Original Message-----
>Mapped drives are stored per user profile. The account
that ASP.NET is
>running under doesn't have the drives mapped. You would
have to use a UNC
>path to the drive.
>I would, however, question what you are doing. Web
applications moving
>files about on a corporate network has some serious
security implications ...
>and your web applications would need to have permissions
on other machines on
>the network. This presents a significant amount of
risk, especially if the
>web site is public-facing. There are less risky ways to
accomplish what you
>need to do without having the web application directly
writing files across
>the network.
>
>"Eje" wrote:
>
>> I have a webapplication on a server. One function is
to
>> build txt-files. These files should then be moved to a
>> fixed directory on another computer in the company
>> network.
>>
>> I have tried to use System.IO.File.Move but get the
>> message "Could not find a part of the path". The path
to
>> the receiving directory is mapped.
>>
>> I get the same message independant of receiving
computer
>> and independant of which command I try under
System.IO. I
>> have no problem to move the files to another location
on
>> the server.
>>
>> With Explorer I have full access to the directories.
>>
>> Does anyone have a solution how to move the files?
>>
>> Eje
>>
>.
Don't see what you're looking for? Try a search.