• Post Reply Bookmark Topic Watch Topic
  • New Topic

File transfer using FTP

 
pranjal mishra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I m working on a module in which I have to generate sales report and then transfer it to a server using FTP connection. The file generation part is working very well. I am using an open source FTP code known as SimpleFTP which I have modified a little bit.
The problem occurs while uploading the file. Its showing Error 125: Data connection already open; transfer starting.
Could any one please suggest me what is the problem. I am attaching the code snippet below.
The file path is hard coded for the test purpose.
The host, user name and passwords have been modified to xxx



Waiting for your reply...
 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd recommend one of the FTP options on our File Upload FAQ. They're more widely used and more rigorously tested.
 
pranjal mishra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joe for the reply but I think that the problem is not with the code part, because I am able to make the connection. When I am trying to write the file then the reader gives the response for Access Denied.
 
pranjal mishra
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I guess I solved the problem. After posting the problem here I installed a FTP client, CuteFTP and did the same thing and i figured it out through the console that it was doing the same thing but for the response 125 which means data connection already open it was uploading the file. So i made the changes in my code and its working perfect.

The changes i made in the above code was at line 207:
so instead of the previous line

I changed it to

Now I am going to write the download code, and as soon as i'll come up with it, i'll post it here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!