473,395 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Uploading Files

When I execute the below code i get the following error "A socket operation was attempted to an unreachable host".

Expand|Select|Wrap|Line Numbers
  1. main_sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
  2. main_ipEndPoint = new IPEndPoint(Dns.GetHostByName(server).AddressList[0], this.port);
  3.  
  4. main_sock.Connect(main_ipEndPoint);
Please help me in this regard.

Thanks and regards,

Govind
Jan 5 '10 #1
6 1387
tlhintoq
3,525 Expert 2GB
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.
Jan 5 '10 #2
tlhintoq
3,525 Expert 2GB
When I execute the below code i get the following error "A socket operation was attempted to an unreachable host".
What exactly do you need help with? The error message is very self explanatory. You tried to establish a connection with a host that can't be reached.

[Telephone operator recording]
"The number you have dialed is not a working number. Please check the number and dial again."
[end recording]
Jan 5 '10 #3
Thanks for your reply.

But when i execute the code mentioned above in .NET 2.0 it gets executed successfully. I want to integrate it in .NET 1.1. How should i achieve this?

Thanks and regards,

Govind
Jan 5 '10 #4
tlhintoq
3,525 Expert 2GB
I don't know for sure.
I would guess that you need to study the differences in how this done in 2.0 and 1.1 and make your code compliant with the 7 year old framework. Maybe 1.1 requires additional setup to be done before invoking this and 2.0 handles it quietly behind the scenes for you. Maybe it was just plain broke in 1.1 and fixed in 2.0. Who knows?

Either that or tell your client that they need to accept the inevitable update to framework 2.

Remind them that framework 4 is soon to be released and that staying so far behind the times is not in any way helping them. Framework updates are FREE.
Jan 5 '10 #5
@tlhintoq
Thanks for your reply.

I need to upload files to a network shared drive in .NET 1.1. Can you please help me in this regard?

Thanks,

Govind
Jan 6 '10 #6
tlhintoq
3,525 Expert 2GB
If it is a shared drive on your network, the just copy the file. It wouldn't be an 'upload'

System.IO.File.Copy(string Source, string Destination);
Jan 6 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
5
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of...
5
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
0
by: Raj | last post by:
Hello, I am planning to provide the Pause/Resume while uploading files. Our site is using both java applet and activex to do this. The list of selected files will be stored in an encrypted...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
2
by: =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= | last post by:
jodleren escribió: I haven't found the PHP manual page where such feature is documented but a few tests have shown that this behaviour changes depending on the charset parameter of the...
1
by: =?Utf-8?B?RGFu?= | last post by:
MS won't seem to let me reply to my old post, so I created a new one. The error occurs in all browsers. It's definitely a server issue, not client. The server is not proxied in any way. I tried...
3
by: muziburrehaman | last post by:
i am looking for code in php to upload the 1 gb files. any one can please help me by sending the code....
0
by: LoriFranklin | last post by:
I'm a bit of a newbie here. I've learned a lot from reading the posts you all have here. I need some help uploading files using an asp form. I am using some code that I found from Jacob at...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.