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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:30:53+00:00 2026-06-09T00:30:53+00:00

Hi all i am uploading the files uploaded by the user in this path

  • 0

Hi all i am uploading the files uploaded by the user in this path

       string savefilename = Path.Combine(Server.MapPath("~/Content/UploadedFiles/"),
                                Path.GetFileName());

And i am saving the Url in the Database in the Url Column in this

        ~/Content/UploadedFiles/BugTrackerDataBase.xlsx

and i am trying to retrieve the file Uploaded by the user by a link in my grid view
my retrieve method looks like this

       public ActionResult ViewAttachments(string AttachmentName)
           {
          try
           {
            AttachmentName = Session["AttachmentUrl"].ToString();
            var fs = System.IO.File.OpenRead(Server.MapPath("'" + AttachmentName + "'"));
            return File(fs, "application/doc", AttachmentName);
        }
        catch
        {
            throw new HttpException(404, "Couldn't find " + AttachmentName);
        }
    } 

and i have the Excepiton

      "Could not find a part of the path 'D:\AnilWork\BugTracker\BugTracker\ViewBug\'UploadedFiles\BugTrackerDataBase.xlsx''."

can any one tell me where am i doing wrong or the write procedure to do this

  • 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-09T00:30:55+00:00Added an answer on June 9, 2026 at 12:30 am

    try

    var fs = System.IO.File.OpenRead(Server.MapPath(" + AttachmentName + "));
    

    instead of

    var fs = System.IO.File.OpenRead(Server.MapPath("'" + AttachmentName + "'"));
    

    it shoud be replaced with (Server.MapPath(“”+ AttachmentName + “”))

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

Sidebar

Related Questions

I am uploading files using jQuery uploadify plugin. All files are uploaded into same
I use the JQuery plugin Uploadify for uploading files. It works fine in all
I am trying to set up a system in which user uploaded files will
Instead of uploading image one by one, how do i achieve to upload all
All my files can be found on GitHub: https://github.com/Integralist/Passage (just in case you need
After all what I've read on this topic, I know that there is no
I'm using a servlet to upload .xls (Excel Spreadsheets) files to the server. I'm
Hope you all will be fine. Actually i want to upload image files from
I have an user registration form and uploading image with other form elements is
I am uploading some image files using servelt. I want to resize the images.

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.