Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 69829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:38:07+00:00 2026-05-10T19:38:07+00:00

Currently I have an application that receives an uploaded file from my web application.

  • 0

Currently I have an application that receives an uploaded file from my web application. I now need to transfer that file to a file server which happens to be located on the same network (however this might not always be the case).

I was attempting to use the webclient class in C# .NET.

    string filePath = 'C:\\test\\564.flv';     try     {         WebClient client = new WebClient();          NetworkCredential nc = new NetworkCredential(uName, password);          Uri addy = new Uri('\\\\192.168.1.28\\Files\\test.flv');         client.Credentials = nc;         byte[] arrReturn = client.UploadFile(addy, filePath);         Console.WriteLine(arrReturn.ToString());     }     catch (Exception ex)     {         Console.WriteLine(ex.Message);     } 

The machine located at 192.168.1.28 is a file server and has a share c:\Files. As of right now I am receiving an error of Login failed bad user name or password, but I can open explorer and type in that path login successfully. I can also login using remote desktop, so I know the user account works.

Any ideas on this error? Is it possible to transfer a file directly like that? With the webclient class or maybe some other class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:38:08+00:00Added an answer on May 10, 2026 at 7:38 pm

    Just use

    File.Copy(filepath, '\\\\192.168.1.28\\Files'); 

    A windows fileshare exposed via a UNC path is treated as part of the file system, and has nothing to do with the web.

    The credentials used will be that of the ASP.NET worker process, or any impersonation you’ve enabled. If you can tweak those to get it right, this can be done.

    You may run into problems because you are using the IP address instead of the server name (windows trust settings prevent leaving the domain – by using IP you are hiding any domain details). If at all possible, use the server name!

    If this is not on the same windows domain, and you are trying to use a different domain account, you will need to specify the username as ‘[domain_or_machine]\[username]’

    If you need to specify explicit credentials, you’ll need to look into coding an impersonation solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 243k
  • Answers 243k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Surely all your client will be using the same binary,… May 13, 2026 at 7:53 am
  • Editorial Team
    Editorial Team added an answer Depending on what exactly your requirements are, Boost.Spirit might be… May 13, 2026 at 7:53 am
  • Editorial Team
    Editorial Team added an answer You can use Enumerable#each_with_index From the official documentation: Calls block… May 13, 2026 at 7:53 am

Related Questions

REASON: I'm working on an emergency alert application that needs to display information on
I have a server application that receives information over a network and processes it.
I've got an application, written in C++, that uses boost::asio. It listens for requests
I have a question and I am very open to suggestions (even very odd

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.