FileUpload fileUpload1;
fileUpload1
should already have the uploaded file, you don't need the path on the client's local drive.
FileUpload.SaveAsfileUpload1.PostedFile.SaveAs
saves to the web server (where the application runs), so it will only work if the IIS process has write access to the target path.
What is the network path you want to write to? Is it on the server or elsewhere?
BTW
\\192.168.1.111\c:\tdata\ makes no sense, you can't access C:\ like that, maybe
\\address\c$ (depending on OS).
-- update --
Details of comment below (quick & dirty method)
A better method is to get the web application to log in to the target machine, but I can't recall what you need to use. Maybe if I have time...
Let's hope someone else replies with a better solution.
-- update 2 --
http://geek.hubkey.com/2008/02/impersonating-built-in-service-account.html[
^]
This shows how to impersonate a user. I have tried it in the past and it works out of the box, but that is for logging onto the local machine. Experiment with it; for example try
\\remotehostname\remotehostuser
as the user name.
-- update 3 --
Sorry, I have never heard of the FSO until now. Judging from the documentation, you probably could use it, but will still need a method to log on from the server (from inside the web app) to the target (where you
save the uploaded files)
From what you described, the scenario is like this -
There are 3 computers involved
[1] web server where the application runs (on IIS)
[2] client PC which uses the web app, via browser
[3] target PC where you save files
You need to allow [1] to log on to [3] from within the app running on IIS, and save files there, without letting anyone else (including [2]) to access the shared folder.
I can't find a good sample immediately. Got to go now, look into the one above in the mean time.