473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

File Upload to different server

mt
Is there a way to upload a file to a different server other than the one
hosting the web app? I've tried using the following syntax:

Request.Files[i].SaveAs("\\\\servername\\sharename\\directory" + strFileName);

but receive the message that the location cannot be found. The Windows
account it is running under has full permissions to this directory.

Thanks!
Nov 16 '05 #1
2 9640
Are you sure that you have impersonation set up correctly to run under
this account? ASP.NET doesn't run under the account set up in IIS config,
but rather, what you set up in the web.config file for the application, or
the ASPNET by default.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mt" <mt@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
Is there a way to upload a file to a different server other than the one
hosting the web app? I've tried using the following syntax:

Request.Files[i].SaveAs("\\\\servername\\sharename\\directory" +
strFileName);

but receive the message that the location cannot be found. The Windows
account it is running under has full permissions to this directory.

Thanks!

Nov 16 '05 #2
mt,

If you have the authentication set to Windows, then it will use windows
to authenticate the user. However, it will still run under the ASPNET local
account. You have to set impersonation to true, through the <identity> tag
in web.config:

<identity impersonate="true"/>

This will have the thread doing the processing run as the Windows user
account that you logged in as. Be careful though, as you are elevating the
permissions of all code that runs under that request, which is generally a
bad thing.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mt" <mt@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.com...
Thanks Nicholas. I assume from your reply that what I'm trying to do
really
is possible, I just need to track down the problem...? In the web.config
file the Authentication Mode is set to Windows. Impersonation is not set
up.
If I understand correctly, when I run the application, it should run under
my user account, which is an administrator on both the web server and the
other server where I want to copy the file. Any ideas?

"Nicholas Paldino [.NET/C# MVP]" wrote:
Are you sure that you have impersonation set up correctly to run
under
this account? ASP.NET doesn't run under the account set up in IIS
config,
but rather, what you set up in the web.config file for the application,
or
the ASPNET by default.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"mt" <mt@discussions.microsoft.com> wrote in message
news:6F**********************************@microsof t.com...
> Is there a way to upload a file to a different server other than the
> one
> hosting the web app? I've tried using the following syntax:
>
> Request.Files[i].SaveAs("\\\\servername\\sharename\\directory" +
> strFileName);
>
> but receive the message that the location cannot be found. The Windows
> account it is running under has full permissions to this directory.
>
> Thanks!


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SU_Oran | last post by:
I found this when searching. I need to have a simple script that will upload a single file. It is giving me an error on Set upl = Server.CreateObject("ASPSimpleUpload.Upload") It is saying : ...
4
by: R Reyes | last post by:
I am trying to code a file uploader (for forum/email attachments) from the client computer to a remote web server via the PUT method (since POST is not allowed ). However, the upload works ONLY...
5
by: Grace | last post by:
Hello, I want to upload the file by webpage to SQL Server. When I upload the small file, it is work. But, when I upload big file(ex. 40~50 MB), it isn't work; the Browser displays the...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
6
by: Pat Carden | last post by:
Hi, We need to allow webusers to upload a file on our website (on Server3, all servers run Server 2003, remotely hosted) and eventually save it on our SBS Server (Server2) which is not exposed...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
4
by: SammyBar | last post by:
Hi all, I wonder is it possible to upload the content of an <imgfield to a server. The content of the <imgwas downloaded from a web site different from the one it should be uploaded. The image...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.