PC Review


Reply
Thread Tools Rate Thread

FTP upload fails

 
 
=?Utf-8?B?SGVucmlr?=
Guest
Posts: n/a
 
      12th Jan 2005
Hi,, can anyone help me???

I have made an FTP-app like the code on:
http://support.microsoft.com/default...b;en-us;832679

But i can't upload a file??? I recives an error when the app is trying to
create the socet for upload?? .... It works on local machine, but not to the
remote server im trying to connect to??

But creating a Folder with "ff.CreateDirectory("FTPFOLDERNEW")"
(MKD-command), works fine on the remote server.. So why can't I allso upload
a file??

Thansk

 
Reply With Quote
 
 
 
 
=?Utf-8?B?TmlraGls?=
Guest
Posts: n/a
 
      12th Jan 2005
Henrick,
I used similar code to create an FTP class but there were
a few problems such as connection timeout parameter cannot be set, it takes
the default value which is around 45 secs if Im not mistaken & this causes a
huge delay in case an FTP Server is not available. Someone out here suggested
using Indy. Sockets and it works very well for me. You can download it at
http://www.indyproject.org.
Below is the code snippet to upload files.

protected void PerformFTP()
{
try
{
client=new Indy.Sockets.FTP();
client.ConnectTimeout=System.Convert.ToInt32(base.ConnectTimeout);
client.TransferTimeout= System.Convert.ToInt32(base.ResponseTimeout);
client.Username =base.UserID;
client.Password=base.Password;
client.Connect(base.IPAddress, 21);
client.Put(base.LocalDirectory + base.UploadFileName, base.UploadFileName,
false);
client.Disconnect();
}
catch(Exception e)
{
base.LogTransaction(base.LogDirectory,e.StackTrace + " " +
e.InnerException );
throw new Exception("Error occured in Clients.FTPIndy.PerformFTP: "+
e.Message + " " + e.InnerException + " " + e.StackTrace );
}
}




"Henrik" wrote:

> Hi,, can anyone help me???
>
> I have made an FTP-app like the code on:
> http://support.microsoft.com/default...b;en-us;832679
>
> But i can't upload a file??? I recives an error when the app is trying to
> create the socet for upload?? .... It works on local machine, but not to the
> remote server im trying to connect to??
>
> But creating a Folder with "ff.CreateDirectory("FTPFOLDERNEW")"
> (MKD-command), works fine on the remote server.. So why can't I allso upload
> a file??
>
> Thansk
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What do FTP servers do when file send fails durring a file upload? Are partial files ever written? does ftp protocol cover this? Daniel Microsoft Dot NET Framework 1 30th Aug 2006 03:38 PM
What do FTP servers do when file send fails durring a file upload? Are partial files ever written? does ftp protocol cover this? Daniel Microsoft C# .NET 1 30th Aug 2006 03:05 AM
What do FTP servers do when file send fails durring a file upload? Are partial files ever written? does ftp protocol cover this? Daniel Microsoft Windows 2000 1 30th Aug 2006 12:29 AM
What do FTP servers do when file send fails durring a file upload? Are partial files ever written? does ftp protocol cover this? Daniel Microsoft Windows 2000 Security 0 30th Aug 2006 12:12 AM
What do FTP servers do when file send fails durring a file upload? Are partial files ever written? does ftp protocol cover this? Daniel Microsoft Dot NET 0 30th Aug 2006 12:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:26 PM.