RE: [PHP] FTP RAW

2002-03-29 Thread Andrew Chase

FTP with raw sockets is a little bit tricky because it actually requires a
second 'data' socket to be opened for each upload/download command.

Check out this excellent FTP class, which *doesn't* require PHP to be
compiled --with-ftp:

http://www.spencernetwork.org/ftp/ftp-class.txt

And of course the FTP Protocol RFC is helpful:

http://www.w3.org/Protocols/rfc959/

-Andy


 -Original Message-
 From: Analysis  Solutions [mailto:[EMAIL PROTECTED]]

  I have written the code to upload using RAW FTP commands.

 Cool!

 How'd you get it to work?

 --Dan


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-28 Thread Analysis Solutions

 I have written the code to upload using RAW FTP commands.

Cool!

How'd you get it to work?

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-26 Thread Chris

Yes. Your solutions fails for any file over 5k about 99% of the time. The
server I use does not have the FTP functions installed so I cannot use
these, that is why I am looking to this solution.'

Chris

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Chris:

 On Mon, Mar 25, 2002 at 02:05:30PM -0700, Chris wrote:
  Can anyone help me with the command I need for a RAW FTP file upload?
  I can create connections and they empty file, but I have no idea how to
get
  the data into the file and I have tried everything.

 Have you tried first creating the file on your system using the fopen(),
 fputs() and fclose() functions?  Once that's done, then you can use
 PHP's FTP functions.

 Enjoy,

 --Dan

 --
 PHP scripts that make your job easier
   http://www.analysisandsolutions.com/code/
  SQL Solution  |  Layout Solution  |  Form Solution
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-26 Thread Analysis Solutions

Hi Chris:

 Yes. Your solutions fails for any file over 5k about 99% of the time. The
 server I use does not have the FTP functions installed so I cannot use

I wouldn't really call it your solution, since it's really the
solution.  FTP stands for File Transfer Protocol.  If you don't have a
file, you don't have FTP.  Your initial post didn't say you didn't have
the FTP functions available.


 that is why I am looking to this solution.

Uh, care to share which solution you're talking about?  The only way we
can help you is if you start geting specific.  Clearly and thoroughly
explain the methods you're using.  Even better, include the code that's
not working.

Another option is to forget the files and FTP alltogether, switching to
sockets instead.  PHP has some new functions for this, but, again, your
server may not have them up.  If that's the case, can you use Perl?

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-26 Thread Chris

OK. I don't know how I can be more specific, but I will try. I have used
fopen(ftp://url) to upload files to the FTP server from a web form, however
this fails on files over 5k in size.

I do not have the FTP functions installed on the server I will be using.

I simply want to know how I would use the raw FTP commands with an
fsockopen() function. I know how to use this to connect to the file server,
change directories, etc.. The question is how do I use the fsocket() with
raw FTP commands to upload a file? Is that not specific?

Analysis  Solutions [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi Chris:

  Yes. Your solutions fails for any file over 5k about 99% of the time.
The
  server I use does not have the FTP functions installed so I cannot use

 I wouldn't really call it your solution, since it's really the
 solution.  FTP stands for File Transfer Protocol.  If you don't have a
 file, you don't have FTP.  Your initial post didn't say you didn't have
 the FTP functions available.


  that is why I am looking to this solution.

 Uh, care to share which solution you're talking about?  The only way we
 can help you is if you start geting specific.  Clearly and thoroughly
 explain the methods you're using.  Even better, include the code that's
 not working.

 Another option is to forget the files and FTP alltogether, switching to
 sockets instead.  PHP has some new functions for this, but, again, your
 server may not have them up.  If that's the case, can you use Perl?

 Enjoy,

 --Dan

 --
 PHP scripts that make your job easier
   http://www.analysisandsolutions.com/code/
  SQL Solution  |  Layout Solution  |  Form Solution
  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-26 Thread Analysis Solutions

Hey Chris:

On Tue, Mar 26, 2002 at 12:44:21PM -0700, Chris wrote:
 OK. I don't know how I can be more specific, but I will try.

Dude, let's look at your initial question to the list:

 Can anyone help me with the command I need for a RAW FTP file
 upload?  I can create connections and they empty file, but I have no
 idea how to get the data into the file and I have tried everything.

That's vague.  Now that you've clarified a bit of how you're doing what
you're trying to do, let's see what we can do to help...


 I have used fopen(ftp://url) to upload files to the FTP server from a 
 web form, however this fails on files over 5k in size.
 
 I do not have the FTP functions installed on the server I will be using.
 
 I simply want to know how I would use the raw FTP commands with an
 fsockopen() function. I know how to use this to connect to the file server,
 change directories, etc.. The question is how do I use the fsocket() with
 raw FTP commands to upload a file? Is that not specific?

Just so I'm being clear, When I was talking about fopen(), fputs() and
fclose(), I meant you need to make a file on your local hard drive
first. I wasn't talking about using these functions directly with the
file pointer generated by fsockopen().  Anwyway, once the file is
created on your drive, THEN, you can use FTP to put the file on the
remote server.

Okay, to be straight up, I haven't used PHP's socket functions yet.  
It's cool, you're able log in and to cd into the right directory.  Uh,
now what to do???  Let's see what the FRC for FTP says...
ftp://ftp.isi.edu/in-notes/rfc959.txt.  How about trying:

   fputs($fp, STOR ./foo.txt\r\n);

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] FTP RAW

2002-03-25 Thread Analysis Solutions

Hi Chris:

On Mon, Mar 25, 2002 at 02:05:30PM -0700, Chris wrote:
 Can anyone help me with the command I need for a RAW FTP file upload?
 I can create connections and they empty file, but I have no idea how to get
 the data into the file and I have tried everything.

Have you tried first creating the file on your system using the fopen(), 
fputs() and fclose() functions?  Once that's done, then you can use 
PHP's FTP functions.

Enjoy,

--Dan

-- 
PHP scripts that make your job easier
  http://www.analysisandsolutions.com/code/
 SQL Solution  |  Layout Solution  |  Form Solution
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php