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

  • Home
  • SEARCH
  • 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 6942233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:59:19+00:00 2026-05-27T12:59:19+00:00

I am using microsoft visual studio to build and publish my site. I was

  • 0

I am using microsoft visual studio to build and publish my site. I was able to publish via ftp to my host godaddy.

My site worked fine locally till I published to the web.

Im getting this error when trying to up load a photo. Do I need to set the folder to read write execute?

Server Error in ‘/’ Application.

Access to the path ‘D:\Hosting\8722453\html\Pictures\1bd71b0f-bd55-48a7-9368-2e8faadf5830.jpg’ is denied.

I believe the proble is on this code block.

if (FileUpload1.HasFile)
                try
                {
                    var FileExtension = Path.GetExtension(FileUpload1.PostedFile.FileName);
                    //FileUpload1.PostedFile.ContentType == 
                    if (FileUpload1.PostedFile.ContentType.ToLower() == "image/jpg" ||
                    FileUpload1.PostedFile.ContentType.ToLower() == "image/jpeg" ||
                    FileUpload1.PostedFile.ContentType.ToLower() == "image/pjpeg" ||
                    FileUpload1.PostedFile.ContentType.ToLower() == "image/gif" ||
                    FileUpload1.PostedFile.ContentType.ToLower() == "image/x-png" ||
                    FileUpload1.PostedFile.ContentType.ToLower() == "image/png")
                    {
                        var Myguid = Guid.NewGuid().ToString("N");

                        var newName = Guid.NewGuid() + FileExtension;
                        //Map path to folder
                        string realpath = Server.MapPath("Pictures\\") + newName;
                        //Where jays converter will store the new image.
                        string temppath = Server.MapPath("Pictures\\");
                        string newpath = Server.MapPath("Images\\");

                        FileUpload1.SaveAs(realpath);

                        Label1.Text = "File name: " +
                             FileUpload1.PostedFile.FileName + "<br>" +

                             FileUpload1.PostedFile.ContentLength + " kb<br>" +
                             "Content type: " +
                             FileUpload1.PostedFile.ContentType;


                        InsertMembers insert = new InsertMembers();
                        int age = Int32.Parse(txtAge.Text);
                        insert.InsertNewMember(txtEmail.Text, Myguid, txtName.Text, txtCity.Text, txtState.Text, txtDescription.Text, age, gender);


                        //Get Member Id to Insert into Pictures table
                        GetMemberInfo GetID = new GetMemberInfo();
                        int UMemberId = GetID.GetMemberId(Myguid);
                        Displayme.Text = newName.ToString();

                        //Now that i have member Id Lets insert new picture into picture table
                        Picture InsertnewPictures = new Picture();
                        int insertpics = InsertnewPictures.InserNewPicture(UMemberId, newName, 0);

                        PhotoUtils.JpegConvertor mynewvar = new PhotoUtils.JpegConvertor(temppath, newpath, newName, 300, 400, false);
                        //PhotoUtils.JpegConvertor mynewvare = new PhotoUtils.JpegConvertor()
                    }
                    else
                    {
                        Displayme.Text = "You can only upload jpg's png's or bmp images.";
                    }
                }
                catch (Exception ex)
                {
                    //Handle the error
                    throw ex;
                }
  • 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-27T12:59:19+00:00Added an answer on May 27, 2026 at 12:59 pm

    are the pictures and images directory within the virtual directory? if not this is one problem. the next thing to check is that users can read and write to those directories. something else to note is that if enough files are changed within a given period of time the IIS process will restart the website (or app pool, i’m not sure which one, of if they are one in the same).

    This may be configurable in IIS, but I’m not sure. I would try to limit the number of file writes as much as possible and work with the images in memory, only writing the final result to disk. another option is to store the images in a database. removing the need to read/write files under the virtual directory.

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

Sidebar

Related Questions

I'm trying to write a dll plugin for Winamp. I'm using Microsoft Visual Studio
How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools
I am using Visual Studio 2008 to build my projects. I often take existing
I have the following question: Does Microsoft Visual Studio (I'm using 2008 SP1) offer
I'm building a file using the CMake Build System and Microsoft's Visual C++ compiler.
We are using Microsoft Visual Studio 2008 Team Explorer Version 9.0.21022.8 Whenever i open
I am using Microsoft Visual Web Developer 2008 Express. I've made an ASP.NET MVC
I'm using Microsoft Visual C# 2008 Express. In my main form, there's that X
I am using a makefile system with the pvcs compiler (using Microsoft Visual C++,
I'm a developer who works on both individual and group projects using Microsoft Visual

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.