Cloudflare blocking FTP -
i've followed official guide sorting out ftp c# server can no longer use ftp webserver, have not edited of code. have server using same ftp method , unaffected (hasn't stopped running before moved cloudflare until now).
does know settings need in cloudflare enable ftp through c#?
filezilla on same machine works fine - time out after minute or so.
if relevant i'm using:
console.writeline("uploading"); ftpwebrequest request = (ftpwebrequest)webrequest.create("ftp://domain.tld/file.json"); request.method = webrequestmethods.ftp.uploadfile; request.credentials = new networkcredential("username", "password"); streamreader sourcestream = new streamreader("file.json"); byte[] filecontents = encoding.utf8.getbytes(sourcestream.readtoend()); sourcestream.close(); request.contentlength = filecontents.length; stream requeststream = request.getrequeststream(); //it gets stuck on line requeststream.write(filecontents, 0, filecontents.length); requeststream.close(); console.writeline("uploaded");
solution: same source provided url on line 2 "ftp://ftp.domain.tld/file.json"
Comments
Post a Comment