|
-
May 15th, 2003, 03:33 PM
#1
Thread Starter
Registered User
How to save a text file to another computer on the same network
In the past, I've saved files to directories that reside on the same machine as the web server. What I want to do today is save files on someone elses machine. I used the following code to save to a directory on the same machine as the web server.
.
.
.
uploadedFile.PostedFile.SaveAs("c:\inetpub\wwwroot\WylePricingSystem\MonthlyArchive\" + myFileName)
.
.
.
I've tried this, to save to a folder on another computer. This folder has all the correct permissions.
.
.
.
uploadedFile.PostedFile.SaveAs("\\computerName\test\" + myFileName)
.
.
.
Does anyone know if and how I can save files to another computer on the network.
Thanks,
James
-
May 27th, 2003, 01:41 PM
#2
Thread Starter
Registered User
I figured out how to save a file to another computer.
add the following to the web.config file"
<system.web>
<identity impersonate="true" userName="mydomain\myusername"
password="mypassword" />
</system.web>
code:
Select a file to upload:<input id="uploadedFile" type="file" name="uploadedFile" runat="server">
Imports System.IO
Dim strFileName As String
strFileName = uploadedFile.PostedFile.FileName
Dim myFileName As String = System.IO.Path.GetFileName(strFileName)
uploadedFile.PostedFile.SaveAs("\\computerName\dir\" + myFileName)
Hope this helps someone.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|