473,394 Members | 1,645 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,394 software developers and data experts.

FTP upload fails

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

Jul 21 '05 #1
1 1691
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

Jul 21 '05 #2

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

Similar topics

15
by: lawrence | last post by:
I've been using the following function (yes, it is inelegant, what can I say, I wrote it a long time ago) to upload images. Haven't had a problem with it for at least a year, and I don't recall...
6
by: Pierre Jelenc | last post by:
I have a file upload set up from a form, which works fine with small files (6k) but fails silently with larger ones (16k and up). The form has: <input type="hidden" name="MAX_FILE_SIZE"...
1
by: PeterB | last post by:
Hi! I'm using Pure ASP File Upload (http://www.asp101.com/articles/jacob/scriptupload.asp) to upload a file from a client to a server. I am testing both on a local IIS and a remote server. The...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
6
by: Vic Spainhower | last post by:
Hello, I am trying to do a FTP file upload which works fine on my localhost but on my ISP server it fails. I can't seem to find where I can go to find the specific cause of the failure. In both...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
6
by: =?ISO-8859-1?Q?J=F8rn?= Dahl-Stamnes | last post by:
I have a strange problem when uploading a PDF document to a web-server. When I try this to a web-server running Apache 2 on a FC 4, it fails. Firefox says that the document contain no data. If I...
7
by: MDB | last post by:
Anyone have any pointers / links / examples on how to upload files through FTP? I am currently using the built in file upload control however it seems to take a very long time to upload files and...
3
by: shapper | last post by:
Hello, I need to upload a file. Can I only do this with the File Upload control? I also need the following: - Send upload info, upload percentage, continuously to a JavaScript function so...
1
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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,...

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.