473,785 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebClient.Uploa dFile error (2nd post)

Hi all gurus, forgive me if I submit a 2nd post, but I'm no more able to see
my question. So:
I wrote an Win app with embedded FTP client (well, made some cut and paste
from others' projects :-)) to receive and send files from within the app
itself. Now the server I connect to (IIS 5, W2K Svr+SP4) from 1st Jan on
will allow just
http/https connection, so I can no longer use FTP. I've thought to use
System.Net.WebC lient class and DownloadFile/UploadFile method, but when I
try UploadFile only obtain a message, described later in detail, while
download goes well. Can pls some1 point me to the right direction? How can I
enable POST on IIS, if this is the problem? TIA

Error message follows:
"System.Net.Web Exception: An exception occurred during a WebClient
request. ---> System.IO.IOExc eption: Unable to write data to the transport
connection. ---> System.Net.Sock ets.SocketExcep tion: Connessione in corso
interrotta forzatamente dall'host remoto
at System.Net.Sock ets.Socket.EndS end(IAsyncResul t asyncResult)
at System.Net.Sock ets.NetworkStre am.EndWrite(IAs yncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Conn ectStream.EndWr ite(IAsyncResul t asyncResult)
at System.Net.Conn ectStream.Write (Byte[] buffer, Int32 offset, Int32
size)
at System.Net.WebC lient.UploadFil e(String address, String method, String
fileName)
--- End of inner exception stack trace ---
at System.Net.WebC lient.UploadFil e(String address, String method, String
fileName)
at System.Net.WebC lient.UploadFil e(String address, String fileName)
at WebApplication1 .WebForm1.Butto n1_Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\WebForm1.a spx.vb:line 31" String".

Nov 21 '05 #1
0 1836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2485
by: Bruno Otero | last post by:
Hi! I have a program that excutes the following code: DirectoryInfo diretorio = new DirectoryInfo(@"C:\teste"); FileInfo arquivos = diretorio.GetFiles("*.xml"); for(int contador=0;contador<arquivos.Length;contador++) { lblMensagem.Text = "Uploading files... ";
6
12247
by: genc ymeri | last post by:
Hi, We are struggeling to upload a file through a C# webClient into JBoss web server. Meanwhile we are able to upload a file from the webserver itself. The problem is only with C# webClient . The code is pretty simple. string uriString = saveTargetToAddress.Text; string postData = textOutput.Text; try
0
1480
by: David W | last post by:
I am trying to upload a file from a user's system to my web server. I found code using the WebClient.UploadFile method. However, the uploaded file is from the server's hard drive not the user's system. I don't want to use the input file method (as this will force the user to do unnessecary browsing and I know where the file will be: c:\test.txt for example). I am sure that I am just missing something simple. However, I can not figure...
4
5434
by: Grant Harmeyer | last post by:
When I try to upload a file to a resource on my local webserver, my code catches an exception that a 405 error (method not supported) has occured on the server. I set the code up nearly exactly as it is shown in the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetwebclientclassuploadfiletopic.asp The only thing I did differently is that I also set the BaseAddress property of the...
1
5243
by: Phillip N Rounds | last post by:
I'm having problems using the WebClient.UploadFile() command. I have MySender.ASPX which is supposed to upload two files to the server. There is also ConsumeFileUpload.aspx which is intended to handle receipt of the files. Pertinent code for each is below. When I run the process locally in debug mode, everything works great ( VS.NET 2003 , ASP 1.1 ). When I run locally on the server, everything works great. When I try to remotely...
0
768
by: Mihaly | last post by:
I have a WinForms 1.1 application and I want to post some files on the webserver, using WebClient.UploadFile() method. I try the solution from MSDN site - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemNetWebClientClassUploadFileTopic1.asp. I creat a ReciveFile.aspx webpage with the content dercribed on this site and I use send the file with this code: WebClient web = new WebClient();...
5
10744
by: Svinja | last post by:
Hi, i am using WebClient.UploadFile to upload a file on my web page, code: WebClient webClient = new WebClient(); webClient.Credentials = new NetworkCredential(userName, pass); webClient.UploadFile("http://www.etfos.hr/~dhuis/test.txt", @"c:\test.txt"); i get an error "The remote server returned an error: (404) FIle not found" my web page is http://www.etfos.hr/~dhuis permissions are all enabled i tried with httpwebrequest class and...
6
4928
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= | last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an error: Could not find file 'C:\testfile.xls'. If I add the file (c:\testfile.xls) to the server I do not get the error and the file is copied from the server to the server, rather than from the web client to the server. Please help!!!
5
5014
by: benmess | last post by:
This code snippet works fine on a localhost because the file you upload resides on the host machine (where FileServer.aspx is a new page invoked from the UploadFile call) function UploadGeneralFile(ByVal sURL as string,ByVal sFilename As String) Dim client As New System.Net.WebClient Dim sHTTPURL As String Dim req As New Uri(sURL) Dim respponse As Byte() sHTTPURL = req.Scheme() & "://" &...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.