I need to program an FTP upload. So far no problem BUT I have to use a proxy to do so. Sadly its not a FTP proxy but a HTTP proxy so I get the typical error that uploading is not available with HTTP proxies. To correct this I tried the typical workaround with ftp.Proxy set to null (nothing in VB). But then I get the error message that the host cannot be found.   So I'm wondering what I'm doing wrong there? OR am I in a situation there where it is impossible to use FtpWebRequest?  FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create("ftp://ftp.targetserver.com/automaticUpload/test.txt"); ftp.Credentials = new NetworkCredential("myuser", "passwd"); ftp.UseBinary = true; //ftp.Proxy = new WebProxy("proxy1"); ftp.Proxy = null; ftp.Method = WebRequestMethods.Ftp.UploadFile;  FileStream fs = File.OpenRead(@"C:\blah\blubb\blah\t1.txt.txt"); byte [] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); fs.Close();  Stream ftpStream = ftp.GetRequestStream(); ftpStream.Write(buffer, 0, buffer.Length);   Edit:  As it seems the information I got there that there is a working workaround was wrong. Thus the other questions answers are fully correct (still) that there is no way to do this with plain c#.
123393
Is there a way to upload a file to a FTP server when behind an HTTP proxy ?  It seems that uploading a file is not supported behind an HTTP Proxy using .Net Webclient. ().  If there is no workaround ? If not, do you know a good and free FTP library I can use ?  Edit: Unfortunately, I don't have any FTP proxy to connect to.
16958
Wanting to deploy my project on different servers I would prefer to be able to specify a connect string using a relative path. I can't seem to get that to work and want to know if there is some trick to it...?
62240
What is the nicest way of replacing the host-part of an Uri using .NET?  I.e.:  string ReplaceHost(string original, string newHostName); //... string s = ReplaceHost("http://oldhostname/index.html", "newhostname"); Assert.AreEqual("http://newhostname/index.html", s); //... string s = ReplaceHost("http://user:pass@oldhostname/index.html", "newhostname"); Assert.AreEqual("http://user:pass@newhostname/index.html", s); //... string s = ReplaceHost("ftp://user:pass@oldhostname", "newhostname"); Assert.AreEqual("ftp://user:pass@newhostname", s); //etc.   System.Uri does not seem to help much.
38924
I am running a 64-bit version of Windows 7 Home Basic. I am trying to update the Windows but the update fails with an error code 80072EE2. I am connected to the internet through proxy.  Here are some things listed in my WindowsUpdate.log:  Access type: No proxy WSUS server: &lt;NULL&gt; WSUS status server: &lt;NULL&gt;   Then the download manager is restoring some persisted download calls. Then,  Initializing Automatic Updates WARNING: SendRequest failed with hr = 80072ee7. Proxy List used: &lt;(null)&gt; Bypass List used : &lt;(null)&gt; Auth Schemes used : &lt;&gt; UpdateDownloadProperties: download priority has changed from 1 to 2. WARNING: Failed to change download properties of call, error = 0x80070057 WARNING: WinHttp: SendRequestToServerForFileInformation MakeRequest failed. error 0x8024402c WARNING: WinHttp: SendRequestToServerForFileInformation failed with 0x8024402c WARNING: WinHttp: ShouldFileBeDownloaded failed with 0x8024402c Error 0x8024402c occurred while downloading update; notifying dependent calls.   There are very many errors/warnings and some other things listed in the log file. I have copied above the ones I thought are relevant to my problem.  Note that I have tried the solution provided on the Microsoft website but that was unable to solve my problem.  Can someone help me resolve this error?
100063
I need to stream a file to the Response for saving on the end user's machine.  The file is plain text, so what content type can I use to prevent the text being displayed in the browser?
106190
Getting an error while trying to script it, specifically "Cannot use VB for services."  Snippet and VB code block as follows:  Raw block (works within ArcMap): "\ftp\raw\YYYYMMDD\Files\Charles" +[NAME]+".ntf"  Snippet:      date = '"20160207"'      arcpy.CalculateField_management(outShp, "Link", '"\\\\ftp\\raw\\"' + date + '"files"' + "[NAME]"+ '".shp"', "VB", "")   Not sure what the issue is, somehow need to be able to insert the date and have it syntactically be correct (in either VB or python).  I didn't explain very well I have a column that contains a portion that is part of the hyperlink, so need to concatenate A column to the end of B column (with the partial path) to complete the link
40839
I'm starting a very little hosting company for a few friends and little clients, nothing big.  I want to give my "clients" the right to manage their files on the server. I hate FTP as it is not secure and it's in my opinion obsolete.  So I'd like to allow my users to connect through SFTP but not allow them to connect through SSH. (I know, I know, SFTP is using SSH). But I was just wondering, is it possible?  So I wouldn't have to install a FTP service on the server and everything would be awesome!
61820
Few years ago I have configured proxy server on freebsd by IT guys. it's functions   register computers by MAC address. filter web sites, messengers, downloads set few computers without internet access set some computers with limited internet access. set some computers with full internet access /using exception by ip/. save and review internet usage of people.   i have manual how to add computer by mac, add ban list website and restrict or exception a computer. but now it's not working and i can't find it guys to fix it  So I want to try it myself on Ubuntu. Please again please tell me how to configure proxy server on Ubuntu STEP BY STEP? It's very important for me. Please help me. Or if you have already documented manual please share with me.  Thank you for your help
24358
I'm trying to retrieve a file from a server using SFTP (as opposed to FTPS) using Java. How can I do this?
121104
In Nginx we have been trying to redirect a URL as follows:  http://example.com/some/path -&gt; http://192.168.1.24   where the user still sees the original URL in their browser. Once the user is redirected, say they click on the link to /section/index.html, we would want this to make a request that leads to the redirect  http://example.com/some/path/section/index.html -&gt; http://192.168.1.24/section/index.html   and again still preserve the original URL.  Our attempts have involved various solutions using proxies and rewrite rules, and below shows the configuration that has brought us closest to a solution (note that this is the web server configuration for the example.com web server). However, there are still two problems with this:   It does not perform the rewrite properly, in that the request URL received by the web server http://192.168.1.24 includes /some/path and therefore fails to serve the required page. When you hover on a link once a page has been served, /some/path is missing from the URL  server {     listen          80;     server_name     www.example.com;      location /some/path/ {         proxy_pass http://192.168.1.24;         proxy_redirect http://www.example.com/some/path http://192.168.1.24;         proxy_set_header Host $host;     }      location / {         index index.html;         root  /var/www/example.com/htdocs;     } }    We are looking for a solution that only involves changing the web server configuration on example.com. We are able to change the config on 192.168.1.24 (also Nginx), however we want to try and avoid this because we will need to repeat this setup for hundreds of different servers whose access is proxied through example.com.
47286
In WebForms, I would normally have code like this to let the browser present a "Download File" popup with an arbitrary file type, like a PDF, and a filename:  Response.Clear() Response.ClearHeaders() ''# Send the file to the output stream Response.Buffer = True  Response.AddHeader("Content-Length", pdfData.Length.ToString()) Response.AddHeader("Content-Disposition", "attachment; filename= " &amp; Server.HtmlEncode(filename))  ''# Set the output stream to the correct content type (PDF). Response.ContentType = "application/pdf"  ''# Output the file Response.BinaryWrite(pdfData)  ''# Flushing the Response to display the serialized data ''# to the client browser. Response.Flush() Response.End()   How do I accomplish the same task in ASP.NET MVC?
30167
when calling SCP in PuTTY on my Win7 box, it doesn't let me use C:/, but I also have no idea where on my local machine it will look for files by default. None of program directory or user directory worked. For example, I saved file.txt next to PuTTY.exe, and also in C:\Users\Me but calling SCP file.txt file.txt in PuTTY failed both times with      cp: cannot stat 'file.txt'   So, how do I transfer a file to my server using PuTTY?  EDIT: Also, calling SCP file.txt myserver:file.txt gives a similar error: file.txt: No such file or directory
92297
So I am running Ubuntu Studio on my laptop and what do I do to connect to a proxy? I search for proxy and in network settings their is no PROXY tab. What are key words in the tabs to look for?
114897
How do I actually run a file on localhost? I know it is working, but how do I run a file on it, and how do I verify that the file is in fact running on localhost?  Server newbie here, additional questions (I have xampp running Apache 2.2): From your responses it sounds like I have to type in the path in the browser in order to open the file on the localhost. So, if I want to have the file in a subdirectory, I would have to type the full path including the directory?   Is there a way to have the browser point to the localhost while I am working on my html, instead of having to type in the path all the time?  I am working in Dreamweaver CS3, and want to use include commands (either SSI or PHP), but not have to keep putting my files up on HostGator in order to see if they are working.  What is the best way to do this (please be specific, I know nothing). If there is a detailed tutorial anywhere, really appreciate a link.  Thank you
61744
My company uses an HTTP proxy and our various Ubuntu 12.04 servers therefore need to be configured properly, namely by setting \etc\apt\apt.conf.d\80proxy to:  Acquire::http::Proxy "http://proxy.mycompany.com:80";  Acquire::http::No-Cache true;   Now, since a few days, this method suddenly stopped working: I run into sum mismatch errors. I have tried all the usual tricks found on stackoverflow or on the web, among others:  sudo rm -fR /var/lib/apt/lists/*     sudo apt-get clean   But nothing seems to work. I even switched to a FTP server, without any luck. What's a radical solution to this problem? Is it likely that the proxy server has some kind of issue? What could it be?  Using Ubuntu 12.04
87441
I am developing a program that continually sends a stream of data in the background and I want to allow the user to set a cap for both upload and download limit.  I have read up on the  and  alghorhithms, and seemingly the latter seems to fit the description since this is not a matter of maximizing the network bandwidth but rather being as unobtrusive as possible.  I am however a bit unsure on how I would implement this. A natural approach is to extend the abstract Stream class to make it simple to extend existing traffic, but would this not require the involvement of extra threads to send the data while simultaneously receiving (leaky bucket)? Any hints on other implementations that do the same would be appreciated.  Also, although I can modify how much data the program receives, how well does bandwidth throttling work at the C# level? Will the computer still receive the data and simply save it, effectively canceling the throttling effect or will it wait until I ask to receive more?  EDIT: I am interested in throttling both incoming and outgoing data, where I have no control over the opposite end of the stream.
93776
I'm trying to write out a  Byte[] array representing a complete file to a file.  The original file from the client is sent via TCP and then received by a server. The received stream is read to a byte array and then sent to be processed by this class.   This is mainly to ensure that the receiving TCPClient is ready for the next stream and separate the receiving end from the processing end.   The FileStream class does not take a byte array as an argument or another Stream object ( which does allow you to write bytes to it).  I'm aiming to get the processing done by a different thread from the original ( the one with the TCPClient).   I don't know how to implement this, what should I try?