473,322 Members | 1,347 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,322 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 1689
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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.