Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. FTPweb request

FTPweb request

Scheduled Pinned Locked Moved ASP.NET
comsysadminhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Laxmikant Lad
    wrote on last edited by
    #1

    Hi friends, i am using ftpwebrequest to upload files on ftp server here is my code. string uri = "ftp://myuserid:mypwd@ftp.shopzilla.com/myfile.txt"; FtpWebRequest reqFTP; reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri)); reqFTP.Proxy = null; reqFTP.Credentials = new NetworkCredential("myuserid", "mypwd"); reqFTP.KeepAlive = false; reqFTP.Method = WebRequestMethods.Ftp.UploadFile; reqFTP.UseBinary = true; reqFTP.ContentLength = fileInf.Length; int buffLength = 2048; byte[] buff = new byte[buffLength]; int contentLen; FileStream fs = fileInf.OpenRead(); try { Stream strm = reqFTP.GetRequestStream(); contentLen = fs.Read(buff, 0, buffLength); while (contentLen != 0) { strm.Write(buff, 0, contentLen); contentLen = fs.Read(buff, 0, buffLength); } strm.Close(); fs.Close(); } catch (WebException webEx) { WriteLog("Adding to Bizrate webex : " + webEx.Response.ToString()); WriteLog("Adding to Bizrate webex : " + webEx.Status.ToString()); WriteLog("Adding to Bizrate webex : " + webEx.Message); } catch (Exception ex) { WriteLog("Adding to Bizrate : " + ex.Message); } i am getting error The remote name could not be resolved: 'ftp.shopzilla.com' and status NameResolutionFailure please give me any solution or link to solve this Thanking you, Laxmikant Lad

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups