473,805 Members | 2,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("\\\\se rvername\\share name\\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 9678
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.co m

"mt" <mt@discussions .microsoft.com> wrote in message
news:6F******** *************** ***********@mic rosoft.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("\\\\se rvername\\share name\\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="tr ue"/>

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.co m

"mt" <mt@discussions .microsoft.com> wrote in message
news:1A******** *************** ***********@mic rosoft.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.co m

"mt" <mt@discussions .microsoft.com> wrote in message
news:6F******** *************** ***********@mic rosoft.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("\\\\se rvername\\share name\\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
7475
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 : Server object, ASP 0177 (0x800401F3) Invalid class string Am I missing something? A DLL perhaps?
4
14528
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 when the file is inside a shared folder on my computer. If I try to upload from any other folder it does not work. Why is this? Reason being that whenever I upload files on other forums or websites I know I don't need to have my folder shared...
5
4779
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 following error message: "The webpage consulted at present is unable to use. Websites may happen the technological question or you need to adjust the browser to establish ."
13
4330
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 that this is suppossed to end up as a component for others to use, and therefore I do NOT have access to their global.cs::Session_End() how do I cleanup files that were uploaded -- but obviously left stranded when the users aborted/gave up writting...
6
4018
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 through our firewall. We have another server (Server1) within the SBS domain that is exposed through port 80 of the firewall on which we host some web services and images. What is the best architecture for getting the file from the remotely...
18
4363
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 get it to upload a file to the FTP server. I just get a "Cannot connect to remote server" error after this TRY: s = New Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
7
3193
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" name="file_1" size=46 /><input type=submit /> so, after adding a few files, the input fields look like this:
4
9094
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 file should not be saved locally before uploading. It should not be visible any <input type=file on the form. How can it be done? I'm working on a project where client javascript requests an image server to generate dynamic images. The client...
1
47495
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
7
7163
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 Silverlight 2.0. To get these tools please visit this page Get Started : The Official Microsoft Silverlight Site and follow Step 1. Occasionally you find the need to have users upload multiple files at once. You could use multiple FileUpload...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10369
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.