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 6593393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:40:35+00:00 2026-05-25T17:40:35+00:00

if (FileUpload1.HasFile) try { FileUpload1.SaveAs(C:\\Users\\Vinay\\Documents\\Visual Studio 2010\\WebSites\\Onlinedoctorsportal\\vini + FileUpload1.FileName); Label10.Text = File name: +

  • 0
if (FileUpload1.HasFile)
            try
            {
                FileUpload1.SaveAs("C:\\Users\\Vinay\\Documents\\Visual Studio 2010\\WebSites\\Onlinedoctorsportal\\vini" + 
                     FileUpload1.FileName);
                Label10.Text = "File name: " +
                     FileUpload1.PostedFile.FileName + "<br>" +
                     FileUpload1.PostedFile.ContentLength + " kb<br>" +
                     "Content type: " +
                     FileUpload1.PostedFile.ContentType;
            }
            catch (Exception ex)
            {
                Label10.Text = "ERROR: " + ex.Message.ToString();
            }
        else
        {
            Label10.Text = "You have not specified a file.";
        }
           //Stream obj = FileUpload1.FileContent;
           //Session["file"] = obj;
           //Response.Redirect("Form3.aspx");
        }
}

what i want is to save the uploaded file to a folder named vini but it is showing the file but not saving it to the specified folder as shown please help

  • 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. Editorial Team
    Editorial Team
    2026-05-25T17:40:36+00:00Added an answer on May 25, 2026 at 5:40 pm

    Firstly you need to escape your string literal that points to the directory

    You can do this by adding an @ before the string, or by putting double backslashes.

    FileUpload1.SaveAs(@"C:\Users\Vinay\Documents\Visual Studio 2010\WebSites\Onlinedoctorsportal\vini" + FileUpload1.FileName);
    

    OR

    FileUpload1.SaveAs("C:\\Users\\Vinay\\Documents\\Visual Studio 2010\\WebSites\\Onlinedoctorsportal\\vini" + FileUpload1.FileName);
    

    Secondly, check that the user that your ASP.NET application pool process is running under has permissions to write to the specified folder.

    A quick check to see if this is the problem is to impersonate your local admin account in your web.config file.

    You can do this by configuring the impersonate tag as follows:

    <identity impersonate="true"
          userName="domain\user" 
          password="password" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an ASP.NET application with C# and Visual Studio 2008 SP1. I'm using
I have this snippet: protected void ProcessUpload(FileUpload upload) { if (upload.HasFile) { string fileName
Dim flag As Boolean = True Dim fileName As String = Path.GetFileName(FileUpload1.PostedFile.FileName) Dim fileExtension
I am using microsoft visual studio to build and publish my site. I was
Protected Sub Upload_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Upload.Click If Me.FileUpload1.HasFile
i've the following code: <asp:UpdatePanel runat=server ID=upPanelFoto> <ContentTemplate> <asp:FileUpload onChange=CaricaFileImmagine(); ID=FileUpload1 runat=server BorderStyle=Solid />
I can upload documents into sharepoint via following code. My document library has 3
I have an application were users can upload pics. The code below allow only
FileUpload img = (FileUpload)UploadImg; Byte[] imgByte = null; if (img.HasFile && img.PostedFile!=null) { HttpPostedFile
I have an ASP FileUpload control and I am uploading: C:\Documents and Settings\abpa\Desktop\TTPublisher\apache-tomcat-6.0.26\webapps\ttpub\WEB-INF\classes\org\gtfs\tmp\GTFS_Rail\routes.txt What

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.