Question : Upload a file to a ftp server usgin c# and asp.net

Hi , using Visual Studio 10 i created an ASP.NET Empty Web Application , i got some code on line that helped me to create the
method for uploading the file in the Upload.aspx.cs file .
i attached the code to this question .
what i am missing is how i send the HttpPostedFile object containing the file to upload from the Upload.aspx web page
how do i transfer this object between the c# code at the server and the aspx page running on the client web site.
i want the client to have a Browse button in the aspx page that will allow him to choose the file to upload
then when he clicks the button i want to activate the method i attached in the c# server side part.
i already have an ftp server configured and running for this.
Help will be greatly appreciated, please send detailed examples .

Thanks.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
private bool UploadToFTP(HttpPostedFile fileToUpload)
        {

            try
            {
                string uploadUrl = @"ftp://logicthought.com";
                string uploadFileName = fileToUpload.FileName;

                Stream streamObj = fileToUpload.InputStream;
                Byte[] buffer = new Byte[fileToUpload.ContentLength];
                streamObj.Read(buffer, 0, buffer.Length);
                streamObj.Close();
                streamObj = null;

                string ftpUrl = string.Format("{0}/{1}", uploadUrl, uploadFileName);
                FtpWebRequest requestObj = FtpWebRequest.Create(ftpUrl) as FtpWebRequest;
                requestObj.Method = WebRequestMethods.Ftp.UploadFile;
                requestObj.Credentials = new NetworkCredential("FTP", "ftp^1595");
                Stream requestStream = requestObj.GetRequestStream();
                requestStream.Write(buffer, 0, buffer.Length);
                requestStream.Flush();
                requestStream.Close();
                requestObj = null;

                return true;
            }
            catch
            {
                return false;
            }
        }

Answer : Upload a file to a ftp server usgin c# and asp.net

They haven't updated the Upgrade Guide in that link yet...it's on the documentation link for 4.1. Here it is:
http://www.vmware.com/pdf/vsphere4/r41/vsp_41_upgrade_guide.pdf

I haven't ran 4.1 upgrade yet, but what I did for 4 was the similar suggestion you made above...I migrated VMs off my host, disconnected my datastore storage (SAN-based, so all I did was disconnect my fibre), performed fresh install on my host, reconnected my shared storage, then migrated VMs back (then I upgraded VMware Tools then Hardware on my VMs). It's more cautious this way...and I tend to side with the way of caution :)

~coolsport00
Random Solutions  
 
programming4us programming4us