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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:31:55+00:00 2026-06-05T15:31:55+00:00

I am adding a functionality to a website so that members can upload there

  • 0

I am adding a functionality to a website so that members can upload there own photos to their profile. The problem that I am having is my FTP capability works fine when I run it own localhost. However, after I put the site up on GoDaddy’s server and try to FTP from there it does not work. I get

Unable to connect to remote server

Here is my code:

protected string savePath = Path.GetTempPath();
protected string saveThumbPath = Path.GetTempPath() + "/Thumb";
Guid g;
protected void UploadButton_Click(object sender, EventArgs e)
{
    bool worked = false;
    if (FileUploadControl.HasFile)
    {
        try
        {
            g = Guid.NewGuid();
            string filename = Path.GetFileName(FileUploadControl.FileName);
            Bitmap src = Bitmap.FromStream(FileUploadControl.PostedFile.InputStream) as Bitmap;
            Bitmap thumb = Bitmap.FromStream(FileUploadControl.PostedFile.InputStream) as Bitmap;

            // Resize the bitmap data
            //Create the large image
            Bitmap result = ProportionallyResizeBitmap(src, 800, 600);
            //string saveName = Server.MapPath(savePath) + g + filename;
            string saveName = savePath + g + filename;
            result.Save(saveName, ImageFormat.Jpeg);
            //Create the thumbnail
            result = ProportionallyResizeBitmap(thumb, 200, 150);
            //string saveThumbName = Server.MapPath(saveThumbPath) + g + filename;
            string saveThumbName = saveThumbPath + g + filename;
            result.Save(saveThumbName, ImageFormat.Jpeg);

            StatusLabel.Text = "Upload status: File uploaded!";
            worked = true;
            Thumbholder.Value = "Thumb" + g + filename;
            Photoholder.Value = g + filename;
// Get the object used to communicate with the server.
//If the specified proxy is an HTTP proxy. only the DownloadFile, ListDirectory and ListDirectoryDetails commands are supported

//get the object used to communicate with the server
System.Net.FtpWebRequest request = System.Net.WebRequest.Create("ftp://mydomain/newcorvetteclub/Images/" + g + filename) as System.Net.FtpWebRequest;
//this example assumes the FTP site uses anoymous login on
//NetWorkCredentials provides credentials for  password-based authentication such as digest, basic, NTLM
request.Credentials = new System.Net.NetworkCredential("username", "password");

//Copy the contents of the file to the request stream
byte[] fileContents = null;
if (FileUploadControl.HasFile)
{
    //fileContents = FileUploadControl.FileBytes;
    fileContents = File.ReadAllBytes(saveName);

}
else
{
    Response.Write("you need to provide a file");
    return;
}
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
request.ContentLength = fileContents.Length;
//GetReequestStream: retrieves the stream used to upload data to an FTP server.
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
System.Net.FtpWebResponse response = request.GetResponse() as System.Net.FtpWebResponse;
//Response.Write("Upload file complete, status: " + response.StatusDescription);
response.Close();
request = System.Net.WebRequest.Create("ftp://mydomain/newcorvetteclub/Images/Thumb" + g + filename) as System.Net.FtpWebRequest;
request.Credentials = new System.Net.NetworkCredential("username", "password");
if (FileUploadControl.HasFile)
{
    fileContents = File.ReadAllBytes(saveThumbName);
}
else
{
    Response.Write("you need to provide a file");
    return;
}
request.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
request.ContentLength = fileContents.Length;
//GetReequestStream: retrieves the stream used to upload data to an FTP server.
requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
response = request.GetResponse() as System.Net.FtpWebResponse;
//Response.Write("Upload file complete, status: " + response.StatusDescription);

Another weird thing is that my email client is doing something similar. It works fine as long as it is being run through localhost but then times out when it it being run from GoDaddy’s servers. Any help would be greatly appreciated.

  • 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-05T15:31:57+00:00Added an answer on June 5, 2026 at 3:31 pm

    I can tell you why the email isn’t going through you have to use “relay-hosting.secureserver.net” as your SMTP Server. As far as the FTP is concerned you can’t do it on godaddy they block outgoing ftp. I just found that out.

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

Sidebar

Related Questions

I'm adding some functionality to my site so that users can upload their own
I'm adding functionality onto our website so that users can download files stored in
I am having trouble adding ajax functionality to existing asp.net 4 website. I have
I can solve the problem of adding functionality by adding sub classing then why
I am adding functionailty to our website so users can upload pictures to our
Adding functionality to a class can be done by adding a method or by
I was adding login and logout functionality to my ASP.NET website. While I am
I am adding functionality to a legacy web application such that in certain circumstances
I have a website which allows members to upload videos, comment on videos, rate
I am adding some basic functionality to my companies website. When a potential employee

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.