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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:44:57+00:00 2026-06-09T01:44:57+00:00

I am creating one MVC3 Razor application.I used file upload.I need to save and

  • 0

I am creating one MVC3 Razor application.I used file upload.I need to save and display image.Uploaded image is not shown in Visual Studio’s folder but when i open same folder from windows then image is shown. After then the upload is working.

My controller:

public ActionResult Save(HttpPostedFileBase attachments)
{
    var fileName = Path.GetFileName(attachments.FileName);
    var physicalPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);
    attachments.SaveAs(physicalPath);
    string fnn = fileName;
    ViewBag.fnn = fnn;
    return Content("");
}
  • 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-06-09T01:44:58+00:00Added an answer on June 9, 2026 at 1:44 am

    As I said in the comment, the items that are shown in folders inside Visual Studio are items that are used for your solution.

    When your application is deployed online and running it won’t have anything to do with VS. VS won’t even be running.

    It looks like you are uploading the file correctly, and it is behaving exactly like it should be. If you want to add the file you uploaded to VS just right click on the folder and select Add then Existing Item and select the file. Granted you didn’t need to upload it to get it into your solution, you could have just added it to the folder to start with.

    If you would like to display the image in your site, you would do something like this:

    <img src="@ViewBag.fnn" alt="Uploaded Image" />
    

    Keep in mind that ViewBag.fnn must have the path to the file, not just the file name. And alt= is just a description of the image.

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

Sidebar

Related Questions

am creating one application for student. I need to show digital clock with remaining
I am creating one application for student. I need to set the different message
I've creating one ASP web application, in that application one form have to update
I am creating one application in which i am using jsp/servlet.. I want to
I'm creating one-click python installer (integrated with my application). Is there any way to
I am creating one jsp page in which I read in a text file,
I am creating one desktop application in which I want to track user activity
I am creating one application in .net MVC, in which I am using jQuery
I have an ASP.NET MVC3 in C# and Razor. The architecture of the application
I've created a REST API in MVC3 and one the things I need to

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.