Re: [PHP] Ftp upload

2011-06-15 Thread Pete Ford

On 15/06/11 01:24, Marc Guay wrote:

I bought a 1GB external hard drive for $1000.  Did I just choke on my lunch?


If that was about 20 years ago, then it would be fine!

--
Peter Ford, Developer phone: 01580 89 fax: 01580 893399
Justcroft International Ltd.  www.justcroft.com
Justcroft House, High Street, Staplehurst, Kent   TN12 0AH   United Kingdom
Registered in England and Wales: 2297906
Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 1XS

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



Re: [PHP] Ftp upload

2011-06-15 Thread Marc Guay
 If that was about 20 years ago, then it would be fine!

Would have been around 1992, good guesswork!

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



Re: [PHP] Ftp upload

2011-06-15 Thread Steve Staples
On Wed, 2011-06-15 at 07:42 -0400, Marc Guay wrote:
  If that was about 20 years ago, then it would be fine!
 
 Would have been around 1992, good guesswork!
 

ugh, i feel old now (even though i am not)... 20 years ago is 1991... i
got my car/motorcycle license in 1992 at the age of 16...

-- 

Steve Staples
Web Application Developer
519.258.2333 x8414


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



[PHP] Ftp upload

2011-06-14 Thread Andre Polykanine
Hi everyone,
I would like to have a possibility to upload really large files to the
website.
As we all know, the post_max_size parameter is set to 8Mb by default.
However,  I  see  that  the  ftp_put() function has a local filepath
parameter.
And  the  question is: how can I retrieve the local filepath if a user
browses to the file from his/her PC?
Thanks!


  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



RE: [PHP] Ftp upload

2011-06-14 Thread admin
Andre, I have checked the $_POST, and THE $_FILES.
I am pretty sure the actual path is not passed. Now you can find the path on 
the server in the tmp_name of the $_FILES array.

I have read a few DOM related issue concerning the PATH of the file uploaded in 
mulitpart/form-data.


Microsoft: Internet Explorer 7 and later. By default, Internet Explorer does 
not include folder or directory path information when uploading files to sites.

So this means the Clients Browser is passing the file name NOT the path.

I am sure if you dig around in JavaScript you may find a way to see the value 
of that attribute on submit or click.
I have never wanted to know the actual file path from the end user, nor has it 
ever been a request for me to do so.


You can however change the ini for upload_max_filesize and post_max_size inside 
of your php script at the top.

html
head
titleA file upload script/title
/head
?php
ini_set('upload_max_filesize', 800);
ini_set(post_max_size, 30M);

$file_dir = .;
$file_url = .;
if ( isset( $fupload ) ){
   print path: $fuploadbr\n;
   print name: $fupload_namebr\n;
   print size: $fupload_size bytesbr\n;
print type: $fupload_typep\n\n;
   if ( $fupload_type == image/gif ){
 copy ( $fupload, $file_dir/$fupload_name) or die (Couldn't copy);
 print img src=\$file_url/$fupload_name\p\n\n;
   }
}
?
body
form enctype=multipart/form-data action=?php print $PHP_SELF? 
method=POST
input type=hidden name=MAX_FILE_SIZE value=51200
input type=file name=fupload
input type=submit value=Send file!
/form
/body
/html



Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 7:38 AM
To: Php General
Subject: [PHP] Ftp upload

Hi everyone,
I would like to have a possibility to upload really large files to the
website.
As we all know, the post_max_size parameter is set to 8Mb by default.
However,  I  see  that  the  ftp_put() function has a local filepath
parameter.
And  the  question is: how can I retrieve the local filepath if a user
browses to the file from his/her PC?
Thanks!


  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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


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



Re: [PHP] Ftp upload

2011-06-14 Thread Andre Polykanine
Hi Richard,

Thanks a lot!
So  can  I  let  them  upload, say, a 700 Mb file via POST or should I
consider connecting to FTP?


-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: ad...@buskirkgraphics.com ad...@buskirkgraphics.com
To: 'Andre Polykanine'
Date created: , 3:41:59 PM
Subject: [PHP] Ftp upload


  Andre, I have checked the $_POST, and THE $_FILES.
I am pretty sure the actual path is not passed. Now you can find the path on 
the server in the tmp_name of the $_FILES array.

I have read a few DOM related issue concerning the PATH of the file uploaded in 
mulitpart/form-data.


Microsoft: Internet Explorer 7 and later. By default, Internet Explorer does 
not include folder or directory path information when uploading files to sites.

So this means the Clients Browser is passing the file name NOT the path.

I am sure if you dig around in JavaScript you may find a way to see the value 
of that attribute on submit or click.
I have never wanted to know the actual file path from the end user, nor has it 
ever been a request for me to do so.


You can however change the ini for upload_max_filesize and post_max_size inside 
of your php script at the top.

html
head
titleA file upload script/title
/head
?php
ini_set('upload_max_filesize', 800);
ini_set(post_max_size, 30M);

$file_dir = .;
$file_url = .;
if ( isset( $fupload ) ){
   print path: $fuploadbr\n;
   print name: $fupload_namebr\n;
   print size: $fupload_size bytesbr\n;
print type: $fupload_typep\n\n;
   if ( $fupload_type == image/gif ){
 copy ( $fupload, $file_dir/$fupload_name) or die (Couldn't copy);
 print img src=\$file_url/$fupload_name\p\n\n;
   }
}
?
body
form enctype=multipart/form-data action=?php print $PHP_SELF? 
method=POST
input type=hidden name=MAX_FILE_SIZE value=51200
input type=file name=fupload
input type=submit value=Send file!
/form
/body
/html



Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 7:38 AM
To: Php General
Subject: [PHP] Ftp upload

Hi everyone,
I would like to have a possibility to upload really large files to the
website.
As we all know, the post_max_size parameter is set to 8Mb by default.
However,  I  see  that  the  ftp_put() function has a local filepath
parameter.
And  the  question is: how can I retrieve the local filepath if a user
browses to the file from his/her PC?
Thanks!


  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



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



RE: [PHP] Ftp upload

2011-06-14 Thread admin
Andre,
Anything over 7 MB to me should be done with FTP. 
You have a lot of issues with file corruption, length of upload, and bandwidth 
on each end.

But you have to remember, I am crazy in the head. I think that customer 
satisfaction is key!!!

Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 10:02 AM
To: ad...@buskirkgraphics.com
Cc: 'Php General'
Subject: Re: [PHP] Ftp upload

Hi Richard,

Thanks a lot!
So  can  I  let  them  upload, say, a 700 Mb file via POST or should I
consider connecting to FTP?


-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: ad...@buskirkgraphics.com ad...@buskirkgraphics.com
To: 'Andre Polykanine'
Date created: , 3:41:59 PM
Subject: [PHP] Ftp upload


  Andre, I have checked the $_POST, and THE $_FILES.
I am pretty sure the actual path is not passed. Now you can find the path on 
the server in the tmp_name of the $_FILES array.

I have read a few DOM related issue concerning the PATH of the file uploaded in 
mulitpart/form-data.


Microsoft: Internet Explorer 7 and later. By default, Internet Explorer does 
not include folder or directory path information when uploading files to sites.

So this means the Clients Browser is passing the file name NOT the path.

I am sure if you dig around in JavaScript you may find a way to see the value 
of that attribute on submit or click.
I have never wanted to know the actual file path from the end user, nor has it 
ever been a request for me to do so.


You can however change the ini for upload_max_filesize and post_max_size inside 
of your php script at the top.

html
head
titleA file upload script/title
/head
?php
ini_set('upload_max_filesize', 800);
ini_set(post_max_size, 30M);

$file_dir = .;
$file_url = .;
if ( isset( $fupload ) ){
   print path: $fuploadbr\n;
   print name: $fupload_namebr\n;
   print size: $fupload_size bytesbr\n;
print type: $fupload_typep\n\n;
   if ( $fupload_type == image/gif ){
 copy ( $fupload, $file_dir/$fupload_name) or die (Couldn't copy);
 print img src=\$file_url/$fupload_name\p\n\n;
   }
}
?
body
form enctype=multipart/form-data action=?php print $PHP_SELF? 
method=POST
input type=hidden name=MAX_FILE_SIZE value=51200
input type=file name=fupload
input type=submit value=Send file!
/form
/body
/html



Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 7:38 AM
To: Php General
Subject: [PHP] Ftp upload

Hi everyone,
I would like to have a possibility to upload really large files to the
website.
As we all know, the post_max_size parameter is set to 8Mb by default.
However,  I  see  that  the  ftp_put() function has a local filepath
parameter.
And  the  question is: how can I retrieve the local filepath if a user
browses to the file from his/her PC?
Thanks!


  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



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



Re: [PHP] Ftp upload

2011-06-14 Thread Eli Orr (Office)

Dear Experts,

Can you please advise how can I detect a string if it is UTF-8 or now 
and how can I if possible

convert a string to a utf-8 ?

Here's the string I got from client - client sends it via POST with 
urlencode and does apply UTF-8

encoding on the string.

Here's the string I got:   
However I do not get the string as a utf-8 (After I do urldecode to the 
client POST parameter)


Please advise

Eli


Re: [PHP] Ftp upload

2011-06-14 Thread Andre Polykanine
Hi Richard,

So,  say,  they  make  audiobooks  or  movies and they want them to be
available   as   (paid)  download.  How  should they upload it so they
would be in the catalog?



-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: ad...@buskirkgraphics.com ad...@buskirkgraphics.com
To: 'Andre Polykanine'
Date created: , 5:46:00 PM
Subject: [PHP] Ftp upload


  Andre,
Anything over 7 MB to me should be done with FTP. 
You have a lot of issues with file corruption, length of upload, and bandwidth 
on each end.

But you have to remember, I am crazy in the head. I think that customer 
satisfaction is key!!!

Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 10:02 AM
To: ad...@buskirkgraphics.com
Cc: 'Php General'
Subject: Re: [PHP] Ftp upload

Hi Richard,

Thanks a lot!
So  can  I  let  them  upload, say, a 700 Mb file via POST or should I
consider connecting to FTP?


-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: ad...@buskirkgraphics.com ad...@buskirkgraphics.com
To: 'Andre Polykanine'
Date created: , 3:41:59 PM
Subject: [PHP] Ftp upload


  Andre, I have checked the $_POST, and THE $_FILES.
I am pretty sure the actual path is not passed. Now you can find the path on 
the server in the tmp_name of the $_FILES array.

I have read a few DOM related issue concerning the PATH of the file uploaded in 
mulitpart/form-data.


Microsoft: Internet Explorer 7 and later. By default, Internet Explorer does 
not include folder or directory path information when uploading files to sites.

So this means the Clients Browser is passing the file name NOT the path.

I am sure if you dig around in JavaScript you may find a way to see the value 
of that attribute on submit or click.
I have never wanted to know the actual file path from the end user, nor has it 
ever been a request for me to do so.


You can however change the ini for upload_max_filesize and post_max_size inside 
of your php script at the top.

html
head
titleA file upload script/title
/head
?php
ini_set('upload_max_filesize', 800);
ini_set(post_max_size, 30M);

$file_dir = .;
$file_url = .;
if ( isset( $fupload ) ){
   print path: $fuploadbr\n;
   print name: $fupload_namebr\n;
   print size: $fupload_size bytesbr\n;
print type: $fupload_typep\n\n;
   if ( $fupload_type == image/gif ){
 copy ( $fupload, $file_dir/$fupload_name) or die (Couldn't copy);
 print img src=\$file_url/$fupload_name\p\n\n;
   }
}
?
body
form enctype=multipart/form-data action=?php print $PHP_SELF? 
method=POST
input type=hidden name=MAX_FILE_SIZE value=51200
input type=file name=fupload
input type=submit value=Send file!
/form
/body
/html



Richard L. Buskirk


-Original Message-
From: Andre Polykanine [mailto:an...@oire.org] 
Sent: Tuesday, June 14, 2011 7:38 AM
To: Php General
Subject: [PHP] Ftp upload

Hi everyone,
I would like to have a possibility to upload really large files to the
website.
As we all know, the post_max_size parameter is set to 8Mb by default.
However,  I  see  that  the  ftp_put() function has a local filepath
parameter.
And  the  question is: how can I retrieve the local filepath if a user
browses to the file from his/her PC?
Thanks!


  

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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




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



Re: [PHP] Ftp upload

2011-06-14 Thread Tamara Temple

On Jun 14, 2011, at 12:59 PM, Andre Polykanine wrote:

So,  say,  they  make  audiobooks  or  movies and they want them to be
available   as   (paid)  download.  How  should they upload it so they
would be in the catalog?


If it's really large data like that, and they have a lot of it, maybe  
upload through the network isn't the best way to go. As Andy Tanenbaum  
put it Never underestimate the bandwidth of a station wagon full of  
tapes speeding across town -- maybe there are better, faster, and  
more reliable ways of getting the data to the server? Overnight  
courier of a huge harddrive maybe faster if there's a lot to get to  
the server. Just a thought.




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



Re: [PHP] Ftp upload

2011-06-14 Thread Richard Quadling
On 14 June 2011 22:27, Tamara Temple tamouse.li...@gmail.com wrote:
 On Jun 14, 2011, at 12:59 PM, Andre Polykanine wrote:

 So,  say,  they  make  audiobooks  or  movies and they want them to be
 available   as   (paid)  download.  How  should they upload it so they
 would be in the catalog?

 If it's really large data like that, and they have a lot of it, maybe upload
 through the network isn't the best way to go. As Andy Tanenbaum put it
 Never underestimate the bandwidth of a station wagon full of tapes speeding
 across town -- maybe there are better, faster, and more reliable ways of
 getting the data to the server? Overnight courier of a huge harddrive maybe
 faster if there's a lot to get to the server. Just a thought.

A USB drive or DVD or DAT or whatever they have and can/will support.



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Ftp upload

2011-06-14 Thread Tamara Temple


On Jun 14, 2011, at 4:42 PM, Richard Quadling wrote:


On 14 June 2011 22:27, Tamara Temple tamouse.li...@gmail.com wrote:

On Jun 14, 2011, at 12:59 PM, Andre Polykanine wrote:


So,  say,  they  make  audiobooks  or  movies and they want them  
to be
available   as   (paid)  download.  How  should they upload it so  
they

would be in the catalog?


If it's really large data like that, and they have a lot of it,  
maybe upload
through the network isn't the best way to go. As Andy Tanenbaum put  
it
Never underestimate the bandwidth of a station wagon full of tapes  
speeding
across town -- maybe there are better, faster, and more reliable  
ways of
getting the data to the server? Overnight courier of a huge  
harddrive maybe

faster if there's a lot to get to the server. Just a thought.


A USB drive or DVD or DAT or whatever they have and can/will support.


Did I just give away my age?

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



Re: [PHP] Ftp upload

2011-06-14 Thread Richard Quadling
On 14 June 2011 23:20, Tamara Temple tamouse.li...@gmail.com wrote:
 Did I just give away my age?

Yes.

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Ftp upload

2011-06-14 Thread Marc Guay
I bought a 1GB external hard drive for $1000.  Did I just choke on my lunch?

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



RE: [PHP] Ftp upload

2011-06-14 Thread admin
LOL yeah.
Since I can buy a 2 terabyte external hard drive and caddy for less than
$300. At Best Buy.

Richard L. Buskirk...


-Original Message-
From: Marc Guay [mailto:marc.g...@gmail.com] 
Sent: Tuesday, June 14, 2011 8:25 PM
To: PHP General
Subject: Re: [PHP] Ftp upload

I bought a 1GB external hard drive for $1000.  Did I just choke on my lunch?

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


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



Re: [PHP] Ftp upload

2011-06-14 Thread Melinda Smith
Marc, I've got a bridge to sell you...

On Tue, Jun 14, 2011 at 6:03 PM, ad...@buskirkgraphics.com wrote:

 LOL yeah.
 Since I can buy a 2 terabyte external hard drive and caddy for less than
 $300. At Best Buy.

 Richard L. Buskirk...


 -Original Message-
 From: Marc Guay [mailto:marc.g...@gmail.com]
 Sent: Tuesday, June 14, 2011 8:25 PM
 To: PHP General
 Subject: Re: [PHP] Ftp upload

 I bought a 1GB external hard drive for $1000.  Did I just choke on my
 lunch?

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


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




[PHP] FTP Site

2010-02-16 Thread Ben Miller
Hi,

 

I'm building a site for a client that has a need to allow their users to
upload large files (up to 100mb or more) and store them on the server.  I've
never had a need to work with PHP's FTP functions until now and, before I go
reading the manual to learn how, I wanted to see if this something that I
can handle with just PHP, or if I'm going to need to adopt a third party
Ajax app or something like that?  Any thoughts or even a point in the right
direction would be greatly appreciated.  Thanks,

 

Ben



Re: [PHP] FTP Site

2010-02-16 Thread Robert Cummings

Ben Miller wrote:

Hi,

I'm building a site for a client that has a need to allow their users to
upload large files (up to 100mb or more) and store them on the server.  I've
never had a need to work with PHP's FTP functions until now and, before I go
reading the manual to learn how, I wanted to see if this something that I
can handle with just PHP, or if I'm going to need to adopt a third party
Ajax app or something like that?  Any thoughts or even a point in the right
direction would be greatly appreciated.  Thanks,


The PHP FTP functions are for client access to a remote server, not so 
that PHP can act as an FTP server. To resolve the issue you'll have to 
either give them FTP access, SSH access, or allow huge uploads. If you 
insist on doing it via PHP, you can use a .htaccess configuration in the 
 directory containing the upload script to override the upload/post 
maximum sizes for PHP. Similarly, you'll need to increase max execution 
time. Since these are clients, I presume they have been authenticated 
first (otherwise you're opening yourself up to DoS). Alternatively you 
could use a Flash plugin or Java applet to facilitate the upload.


Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

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



Re: [PHP] FTP Site

2010-02-16 Thread Ryan Sun
I think you will need the help from a client side app, like java
applet or flash, php can transfer file from your web server to your
ftp server but people will have difficulty uploading file via bare
browser

On Tue, Feb 16, 2010 at 3:12 PM, Ben Miller biprel...@gmail.com wrote:
 Hi,



 I'm building a site for a client that has a need to allow their users to
 upload large files (up to 100mb or more) and store them on the server.  I've
 never had a need to work with PHP's FTP functions until now and, before I go
 reading the manual to learn how, I wanted to see if this something that I
 can handle with just PHP, or if I'm going to need to adopt a third party
 Ajax app or something like that?  Any thoughts or even a point in the right
 direction would be greatly appreciated.  Thanks,



 Ben



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



Re: [PHP] FTP Site

2010-02-16 Thread Ashley Sheridan
On Tue, 2010-02-16 at 15:21 -0500, Robert Cummings wrote:

 Ben Miller wrote:
  Hi,
  
  I'm building a site for a client that has a need to allow their users to
  upload large files (up to 100mb or more) and store them on the server.  I've
  never had a need to work with PHP's FTP functions until now and, before I go
  reading the manual to learn how, I wanted to see if this something that I
  can handle with just PHP, or if I'm going to need to adopt a third party
  Ajax app or something like that?  Any thoughts or even a point in the right
  direction would be greatly appreciated.  Thanks,
 
 The PHP FTP functions are for client access to a remote server, not so 
 that PHP can act as an FTP server. To resolve the issue you'll have to 
 either give them FTP access, SSH access, or allow huge uploads. If you 
 insist on doing it via PHP, you can use a .htaccess configuration in the 
   directory containing the upload script to override the upload/post 
 maximum sizes for PHP. Similarly, you'll need to increase max execution 
 time. Since these are clients, I presume they have been authenticated 
 first (otherwise you're opening yourself up to DoS). Alternatively you 
 could use a Flash plugin or Java applet to facilitate the upload.
 
 Cheers,
 Rob.
 -- 
 http://www.interjinn.com
 Application and Templating Framework for PHP
 


Flash or Java are the best way to go for this. The browser isn't good
for large file uploads, I've had too many fail when the files got too
large, even when the server was set up to allow them.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] FTP Site

2010-02-16 Thread Rene Veerman
The only 1 i ever got to work properly for files   100 mb is
http://jumploader.com/
It's java, and free.

On Tue, Feb 16, 2010 at 9:12 PM, Ben Miller biprel...@gmail.com wrote:
 Hi,



 I'm building a site for a client that has a need to allow their users to
 upload large files (up to 100mb or more) and store them on the server.  I've
 never had a need to work with PHP's FTP functions until now and, before I go
 reading the manual to learn how, I wanted to see if this something that I
 can handle with just PHP, or if I'm going to need to adopt a third party
 Ajax app or something like that?  Any thoughts or even a point in the right
 direction would be greatly appreciated.  Thanks,



 Ben



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



Re: [PHP] FTP Site

2010-02-16 Thread Michael A. Peters

Ben Miller wrote:

Hi,

 


I'm building a site for a client that has a need to allow their users to
upload large files (up to 100mb or more) and store them on the server.  I've
never had a need to work with PHP's FTP functions until now and, before I go
reading the manual to learn how, I wanted to see if this something that I
can handle with just PHP, or if I'm going to need to adopt a third party
Ajax app or something like that?  Any thoughts or even a point in the right
direction would be greatly appreciated.  Thanks,

 


You might want to look at how the mozilla add-on firefogg does it.
They have server code example for php.

Basically it splits the file up into chunks (as it encodes it but 
encoding isn't your concern) and when a chunk is received, message is 
sent back to the client telling the client it is OK to send the next chunk.


It may be dependent upon browser functionality though, since it is the 
browser that splits the large upload into smaller manageable chunks.


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



[PHP] FTP: File or directory?

2009-08-14 Thread Clancy
I have just got access to a new server, and am playing with upload/download 
procedures. I
looked in the root directory, and see several objects which I assume to be 
directories.
However I was surprised to find there does not appear to be any command to 
determine if an
object is a file or directory, either in PHP FTP or plain FTP.  I could try to 
change to
them, or download them, but this seems overkill.  Am I overlooking something 
obvious?

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



Re: [PHP] ftp root dir?

2007-05-24 Thread Richard Lynch
On Tue, May 22, 2007 10:19 am, Al wrote:
 I know that; but, I writing a script, that can be used on different
 servers, which creates a directory and I want to
 make certain it is created on the DOC ROOT.  I don't want the user to
 have to test the ftp connection with a ftp utility
 program first.

What you want and how the world actually exists are not matching up...

We cannot fix that...

:-v

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] ftp root dir?

2007-05-24 Thread Richard Lynch
On Tue, May 22, 2007 9:50 am, Al wrote:
 Can I assume that all ftp_connect()s will make the current dir the
 DOC_ROOT?

Probably not.

If I FTP connect to *my* webhosted servers, I'm put into a directory
which contains 'www' and 'php' and 'private' which are set up by the
host for 'DOCUMENT_ROOT' 'include_path' and 'openbase_dir'
respectively, as well as any other directories/files I chose to add
there.

It all depends how FTP and www server are configured, and they are not
tied at the hip by any means.

 If not, how can I insure the ftp root dir is the same as DOC_ROOT?

You'll have to ASK the user to config their own account to map things
up, I guess...

 You can't use the absolute path with ftp.

Again, depends on FPT server and setup -- Some FTP setups accept an
absolute path and allow the FTP user to start at the '/' box root
directory, but not all the time.

 chdir() doesn't change the ftp current dir.

No, it changes the directory on your PHP server box.

 if you ftp_chdir() and it's already on the root, it posts an error.

You should be able to catch that and get rid of it.

 ftp_pwd() simply returns /, which simply says it's on its root,
 where ever that is.

Yes.

That is where it is.

Unless it's been configured to not only have its own root, but also to
change the user to a non-root directory upon login, which is also
possible setup, especially when the user is allowed to run rampant all
over hte box, and the FTP server relies on user/access permissions on
the box to control access.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] ftp root dir?

2007-05-22 Thread Al

Can I assume that all ftp_connect()s will make the current dir the DOC_ROOT?

If not, how can I insure the ftp root dir is the same as DOC_ROOT?

You can't use the absolute path with ftp.

chdir() doesn't change the ftp current dir.

if you ftp_chdir() and it's already on the root, it posts an error.

ftp_pwd() simply returns /, which simply says it's on its root, where ever 
that is.

Thanks

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



Re: [PHP] ftp root dir?

2007-05-22 Thread Al
I know that; but, I writing a script, that can be used on different servers, which creates a directory and I want to 
make certain it is created on the DOC ROOT.  I don't want the user to have to test the ftp connection with a ftp utility 
program first.




Jim Moseby wrote:

r?


Can I assume that all ftp_connect()s will make the current 
dir the DOC_ROOT?


If not, how can I insure the ftp root dir is the same as DOC_ROOT?

You can't use the absolute path with ftp.

chdir() doesn't change the ftp current dir.

if you ftp_chdir() and it's already on the root, it posts an error.

ftp_pwd() simply returns /, which simply says it's on its 
root, where ever that is.


The ftp_* functions behave just as any ftp client behaves, AFAIK.  If you
log into the FTP server via your favorite command-line FTP client, you are
seeing the exact same behaviour as the ftp_* functions will see.

JM


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



RE: [PHP] ftp root dir?

2007-05-22 Thread Jim Moseby
r?
 
 
 Can I assume that all ftp_connect()s will make the current 
 dir the DOC_ROOT?
 
 If not, how can I insure the ftp root dir is the same as DOC_ROOT?
 
 You can't use the absolute path with ftp.
 
 chdir() doesn't change the ftp current dir.
 
 if you ftp_chdir() and it's already on the root, it posts an error.
 
 ftp_pwd() simply returns /, which simply says it's on its 
 root, where ever that is.

The ftp_* functions behave just as any ftp client behaves, AFAIK.  If you
log into the FTP server via your favorite command-line FTP client, you are
seeing the exact same behaviour as the ftp_* functions will see.

JM

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



Re: [PHP] ftp root dir?

2007-05-22 Thread Robert Cummings
On Tue, 2007-05-22 at 11:19 -0400, Al wrote:
 I know that; but, I writing a script, that can be used on different servers, 
 which creates a directory and I want to 
 make certain it is created on the DOC ROOT.  I don't want the user to have to 
 test the ftp connection with a ftp utility 
 program first.

You can only do that if you have control over the ftp server settings
such that the FTP directory overlaps your DOC_ROOT at some point. And
even then you need to know exactly how it overlaps since FTP doesn't
expose it's real location to FTP clients (at least not that I know of).

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re[2]: [PHP] ftp root dir?

2007-05-22 Thread Richard Davey
Hi Al,

Tuesday, May 22, 2007, 4:19:22 PM, you wrote:

 I know that; but, I writing a script, that can be used on different
 servers, which creates a directory and I want to 
 make certain it is created on the DOC ROOT.  I don't want the user
 to have to test the ftp connection with a ftp utility 
 program first.


I'd have to say 'impossible'. This value isn't stored in any one
variable or even in a system value you can rely on.

For example you could probably extract the FTP home directory of a
given user on a Unix system with a bit less pain than on a Windows
server, but within IIS which managers FTP on Windows, you'd have to
query the IIS service itself (via its COM object) to find out the home
dir of a user, which will (and can) vary per user, assuming they even
have one set.

That doesn't even begin to cover all the various other FTP Servers out
there, such as ServU, GlobalScape, TitanFTP, FileZilla Server,
SurgeFTP, etc, etc. Each one holds its users root directories in
different ways, and you'd need to know them *all*. Some hold them in
ini files, some in xml, some in the registry, some in custom binary
formats. You get the idea.

Like I said, I think you're heading into 'impossible' territory here.
Find another way to achieve the same end result.

Cheers,

Rich
-- 
Zend Certified Engineer
http://www.corephp.co.uk

Never trust a computer you can't throw out of a window

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



[PHP] FTP issues

2007-02-28 Thread Larry Bradley
The following issues are not really PHP issues, but more properly FTP 
server issues, but perhaps people on the list have some ideas on how to 
solve my problems.


I've written a PHP program to mirror data on a local drive to a remote 
FTP server. It compares file mod times, and only uploads files that are 
newer.  Works like a charm. Except ---


The remote FTP server is running on a Fedora LINUX system, but I think any 
server would present the same issues.


To examine the remote directories, I use ftp_rawlist() to get a directory 
listing which I parse. However, the file modification time does not have a 
year, and does not show the seconds. I get around this by assuming the 
year is the current one, and then compare the file times of the local and 
remote files ignoring local file seconds. If they are different, I use 
ftp_mdtm() to get the real remote time, and then do my compare. This slows 
things down a bit, as I have to go to the FTP server one more time.


Any thoughts on how to get around this? Is there a way to get a better 
directory listing?


Second and more serious problem is that when I FTP the file to the server, 
the file mod time gets set to the current (file-creation) time. The same 
thing happens in a local-to-local file copy using copy(), but I can use 
touch() to update the mod time.


Any thoughts on how I might get the remote FTP server to do the equivalent 
of touch()?


I realize that these are not actual PHP problems, but maybe one of you has 
run across similar issues.


Many thanks.

Larry Bradley
Orleans (Ottawa), Ontario, CANADA 


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



Re: [PHP] FTP issues

2007-02-28 Thread Jochem Maas
is your 'local system' linux? then the totally non answer is probably
that you should be using rsync.

if it's a windows machine you can probably still use rsync there by running
it on top of cygwin.

I would also recommend tunnelling the rsync traffic through an SSH connection.

Larry Bradley wrote:
 The following issues are not really PHP issues, but more properly FTP
 server issues, but perhaps people on the list have some ideas on how to
 solve my problems.
 
 I've written a PHP program to mirror data on a local drive to a remote
 FTP server. It compares file mod times, and only uploads files that are
 newer.  Works like a charm. Except ---
 
 The remote FTP server is running on a Fedora LINUX system, but I think
 any server would present the same issues.
 
 To examine the remote directories, I use ftp_rawlist() to get a
 directory listing which I parse. However, the file modification time
 does not have a year, and does not show the seconds. I get around this
 by assuming the year is the current one, and then compare the file
 times of the local and remote files ignoring local file seconds. If they
 are different, I use ftp_mdtm() to get the real remote time, and then do
 my compare. This slows things down a bit, as I have to go to the FTP
 server one more time.
 
 Any thoughts on how to get around this? Is there a way to get a better
 directory listing?
 
 Second and more serious problem is that when I FTP the file to the
 server, the file mod time gets set to the current (file-creation) time.
 The same thing happens in a local-to-local file copy using copy(), but I
 can use touch() to update the mod time.
 
 Any thoughts on how I might get the remote FTP server to do the
 equivalent of touch()?
 
 I realize that these are not actual PHP problems, but maybe one of you
 has run across similar issues.
 
 Many thanks.
 
 Larry Bradley
 Orleans (Ottawa), Ontario, CANADA

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



Re: [PHP] FTP issues

2007-02-28 Thread Richard Lynch
On Wed, February 28, 2007 8:21 am, Larry Bradley wrote:
 I've written a PHP program to mirror data on a local drive to a
 remote
 FTP server. It compares file mod times, and only uploads files that
 are
 newer.  Works like a charm. Except ---

Did you consider just using rsync?...

 To examine the remote directories, I use ftp_rawlist() to get a
 directory
 listing which I parse. However, the file modification time does not
 have a
 year, and does not show the seconds. I get around this by assuming
 the
 year is the current one, and then compare the file times of the local
 and
 remote files ignoring local file seconds. If they are different, I use
 ftp_mdtm() to get the real remote time, and then do my compare. This
 slows
 things down a bit, as I have to go to the FTP server one more time.

If the minutes are different, why would you bother to check the
seconds?...

 Any thoughts on how to get around this?

 Is there a way to get a better
 directory listing?

I've seen some FTP servers that response to 'ls -als' with about what
you'd expect from the shell.

How they do it, I dunno, but I like it.

 Second and more serious problem is that when I FTP the file to the
 server,
 the file mod time gets set to the current (file-creation) time. The
 same
 thing happens in a local-to-local file copy using copy(), but I can
 use
 touch() to update the mod time.

rsync would fix this.

You could also look at scp which allows you to specify that you want
to maintain file attributes.

 Any thoughts on how I might get the remote FTP server to do the
 equivalent
 of touch()?

Actually, I should think you'd want to convince the server to know
when the file was REALLY created/modifed based on the local file, not
force the local file to look different just to accomodate the FTP
server.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] FTP + Password ?

2007-02-14 Thread Helder Lopes

i people. I need a help.

How to put a password in a folder, in the ftp, via a script?

Anybody knows??

Im pt, Sorry for my english!!


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



[PHP] FTP Error

2007-01-19 Thread Eddie Schnell

Description:

Warning: ftp_put(): php_connect_nonb() failed: No route to host (65)

I get this error with the reproduce code. it also says Warning: ftp_put():
Type set to I.

It is not uploading the file correctly.

i have php 4.4.1 on iPowerWeb's server, so no upgrade is possible.

Thanks in Advance

Reproduce code:
---
$conn_id = ftp_connect(ftpServer);
$login_result = ftp_login($conn_id, userName, passWord);
ftp_pasv($conn_id, true);
if ((!$conn_id) || (!$login_result)) {
   echo FTP connection has failed!;
   echo Attempted to connect to stp server for user username;
   exit;
   } else {
   echo Connected to ftp server, for user user;
   }
$upload = ftp_put($conn_id, bgd.txt, bgdlocal.txt, FTP_BINARY);
if (!$upload) {
   echo FTP upload has failed!;
   } else {
   echo Uploaded $source_file to $ftp_server as $destination_file;
   }
// close the FTP stream
ftp_close($conn_id);

Expected result:

Uploaded $source_file to $ftp_server as $destination_file

Actual result:
--
Warning: ftp_put(): php_connect_nonb() failed: No route to host (65) in
/home/beachgla/public_html/catalog/update/index.php on line 475

Warning: ftp_put(): Type set to I. in
/home/beachgla/public_html/catalog/update/index.php on line 475

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



Re: [PHP] FTP Error

2007-01-19 Thread Jim Lucas

 Warning: ftp_put(): php_connect_nonb() failed: No route to host (65) in
 /home/beachgla/public_html/catalog/update/index.php on line 475
This tells me that you are unable to find/connect to the ftpServer 
that you are giving ftp_connect()



I am wondering if your conditional was not working like it should, try 
this instead


if ( $conn_id  $login_result ) {
echo Connected to ftp server, for user user;
} else {
echo FTP connection has failed;
echo Attempted to connect to ftp server for user username;
exit;
}


Jim Lucas

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



[PHP] Ftp a file--errors in rendered page, Ftp the file again--works fine. Huh?

2006-11-23 Thread Nicholas Crosby
Hello:

I would appreciate any help on this that someone might have. A student of
mine found this issue. He ftp's a file to a server and looks at it through a
browser, there are errors. He uploads the file again, it works fine. I am
stumped. Any ideas? Here is the text of the file that he is uploading.
Basically, if you add some more text to the bottom and upload it, the page
will not generate the proper output.

html
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
titleHello, World!/title
/head
body
p align=centerfont size=24 face=Arial color=#4040F0
?php
// Helloworld.php
// This is my first PHP program.
include(header.htm);
echo Hello,World!;
echo /font;
echo p align='right'font face='verdana' size='12' color='#123456';
echo br /Hello,World!;
echo /font;
echo p align='left'font face='verdana' size='6' color='#abcdef';
echo br /Hello,World!;
echo /font;
include(footer.htm);
?
/p
This is a bunch of text that has been added.
This is some more text that has been added.
centerPage 1 a href=includes2.phpPage 2/a a
href=includes3.phpPage 3/a/center
this is some more text.
/body
/html

This is the source for the generated page:

html
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
titleHello, World!/title
/head
body
p align=centerfont size=24 face=Arial color=#4040F0
font face=verdana, size=7 color=123456
Includes are Cool!!/font
hr /Hello,World!/fontp align='right'font face='verdana' size='12'
color='#123456'br /Hello,World!/fontp align='left'font
face='verdana' size='6' color='#abcdef'br /Hello,World!/font
hr
centerMark Woynarski/centerbr
centerComp204/centerbr
centercopy; 2006 Mark Woynarski.  Unauthorized redistribution is subject
to an ass-kicking./center
/p
centerPage 1 a href=includes2.phpPage 2/a a
href=includes3.phpPage 3/a/center
this is some more text.
/body
/htmler
this is some more text.
/body
/htmlr
this is some more text.
/body
/html


Notice that there are 3 sets of ending body / html tags.

If you upload the file a second time, the page is generated with only one
set of body/html tags.

Any ideas?

Thanks in advance.

nick
[EMAIL PROTECTED]

Nick

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



Re: [PHP] Ftp a file--errors in rendered page, Ftp the file again--works fine. Huh?

2006-11-23 Thread Travis Doherty
Nicholas Crosby wrote:

Hello:

I would appreciate any help on this that someone might have. A student of
mine found this issue. He ftp's a file to a server and looks at it through a
browser, there are errors. He uploads the file again, it works fine. I am
stumped. Any ideas? Here is the text of the file that he is uploading.
Basically, if you add some more text to the bottom and upload it, the page
will not generate the proper output.
  

The file is uploaded using an FTP client or it is uploaded using PHP's
FTP functions?

If I understand correctly, it sounds like the FTP client is having
troubles uploading the file.  Try to minimize the script and see if you
can still reproduce:

?php
echo htmlbodyHello/body/html;
?

If you upload a script like that, does it get something simple done
correctly or does that also require a second upload?

Travis

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



Re: [PHP] FTP - folders

2006-10-24 Thread Roman Neuhauser
Don't top-post.

# [EMAIL PROTECTED] / 2006-10-23 20:35:16 -0500:
 On 10/23/06, tedd [EMAIL PROTECTED] wrote:
 At 8:42 PM +0100 10/23/06, Stut wrote:
 Rob Kritzer wrote:
 Is it possible to FTP a folder and all it's content? I can do a
 file at a time, but not a folder.
 
 Also there is times when I will not know the folder name, so I
 would like it to just upload everything it finds in the folder I
 set.
 
 Is this possilbe?
 
 Yes[1][2].
 
 [1] http://catb.org/~esr/faqs/smart-questions.html
 [2] There is no function to upload a folder, but it's quite easy to
 code. Check out http://php.net/glob and/or http://php.net/readdir
 
 Perhaps I'm confused (certainly could be), but I think the OP is
 asking for a way to upload multiple files from a desktop folder to a
 server (client-side to sever-side) by just selecting the desktop
 (client-side) folder.

 Yes Tedd,
 
 This is what I am having trouble with, I can see where you can upload
 each file, but all I really need it to do is take the contents of a
 folder and upload everything it finds in the directory.

This is unrelated to PHP.

And please:

1. You asked about FTPing whole directories.
2. You meant to ask about a feature missing from your browser that
   would allow you to mark whole directories for upload.

FTP a folder is already pretty vague but the second problem makes
this moot anyway. Do read the catb.org reference carefully.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] FTP - folders

2006-10-24 Thread tedd

At 8:35 PM -0500 10/23/06, Rob Kritzer wrote:

Yes Tedd,

This is what I am having trouble with, I can see where you can upload each
file, but all I really need it to do is take the contents of a folder and
upload everything it finds in the directory.

Rob


Rob:

I understand what you're trying to do, and it _is_ php related -- 
ignore the troll.


Richard and Stut provided reference to the solution, namely:

http://us2.php.net/sockets

I have not done this myself, but I think the idea* is to have your 
server-side php script communicate with a your client-side php script 
via socket functions. As you can see, this takes two scripts -- one 
server-side and the other client-side. If you cannot set-up php on 
both ends, then you are left with uploading only one file at a time 
via a server-side php script.


hth's

tedd


* Gang -- please correct me if I'm wrong.
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] FTP - folders

2006-10-23 Thread Rob Kritzer

Is it possible to FTP a folder and all it's content? I can do a file at a
time, but not a folder.

Also there is times when I will not know the folder name, so I would like it
to just upload everything it finds in the folder I set.

Is this possilbe?

Thanks


Re: [PHP] FTP - folders

2006-10-23 Thread Stut

Rob Kritzer wrote:

Is it possible to FTP a folder and all it's content? I can do a file at a
time, but not a folder.

Also there is times when I will not know the folder name, so I would 
like it

to just upload everything it finds in the folder I set.

Is this possilbe?


Yes[1][2].

-Stut

[1] http://catb.org/~esr/faqs/smart-questions.html
[2] There is no function to upload a folder, but it's quite easy to 
code. Check out http://php.net/glob and/or http://php.net/readdir


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



Re: [PHP] FTP - folders

2006-10-23 Thread tedd

At 8:42 PM +0100 10/23/06, Stut wrote:

Rob Kritzer wrote:

Is it possible to FTP a folder and all it's content? I can do a file at a
time, but not a folder.

Also there is times when I will not know the folder name, so I would like it
to just upload everything it finds in the folder I set.

Is this possilbe?


Yes[1][2].

-Stut

[1] http://catb.org/~esr/faqs/smart-questions.html
[2] There is no function to upload a folder, but it's quite easy to 
code. Check out http://php.net/glob and/or http://php.net/readdir


-Stut:

Perhaps I'm confused (certainly could be), but I think the OP is 
asking for a way to upload multiple files from a desktop folder to a 
server (client-side to sever-side) by just selecting the desktop 
(client-side) folder.


Maybe I should read [1] a little closer, but I did read [2] and I 
don't see where one can use php to open a folder on a desktop, read 
its contents, and then upload the files therein. However, I do see a 
way to upload individual files, but not multiple files _unless_ the 
user selects them one at a time and then uploads them consecutively 
via a loop. But, that still requires the user to select the files 
individually and not the folder that contains them.


I certainly can read the contents of a folder on the server, but I 
don't see how you can do it client-side.


Now, am I right, or do you have a way to do this?

Thanks.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] FTP - folders

2006-10-23 Thread Richard Lynch
On Mon, October 23, 2006 4:18 pm, tedd wrote:
 I certainly can read the contents of a folder on the server, but I
 don't see how you can do it client-side.

E.

You could install PHP on the client and do it with PHP.

Or it could be TOTALLY OFF-TOPIC

 Now, am I right, or do you have a way to do this?

How many FTP tools are out there that let you specify a whole
directory, some portion thereof, or all kinds of ways to pick and
choose files to upload?

Dozens, nay, hundreds.

Some of them even work quite nicely.

On the Mac, I always dug Fetch personally.

PC, you got your CuteFTP and all that ilk.

Now, on *nix, SCP is nice for that, if you have SSH shell access.  If
not, I dunno...  Never have stumbled across a good utility for that. 
Never looked super hard either, as glob usually works in FTP shell,
and when it doesn't, well, I can ususally find some way around that
too.

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] FTP - folders

2006-10-23 Thread Ed Lazor


On Oct 23, 2006, at 2:27 PM, Richard Lynch wrote:


On the Mac, I always dug Fetch personally.


Nice... I've been looking for something like Fetch.


PC, you got your CuteFTP and all that ilk.


SecureFTP by VanDyke rocks.


Now, on *nix, SCP is nice for that, if you have SSH shell access.  If
not, I dunno...  Never have stumbled across a good utility for that.
Never looked super hard either, as glob usually works in FTP shell,
and when it doesn't, well, I can ususally find some way around that
too.


ncftp for general stuff on Unix has always been my favorite.  I  
default to things like scp when I need secure transfers of data.


-Ed

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



Re: [PHP] FTP - folders

2006-10-23 Thread tedd

At 4:27 PM -0500 10/23/06, Richard Lynch wrote:

On Mon, October 23, 2006 4:18 pm, tedd wrote:

 I certainly can read the contents of a folder on the server, but I
 don't see how you can do it client-side.


E.

You could install PHP on the client and do it with PHP.


Interesting.

So a php server-side php script can establish a two-way communication 
with a client-side php script -- do you have an example?




Or it could be TOTALLY OFF-TOPIC


I didn't assume that it was -- too many considerations. I have enough 
problems understanding what's on my plate as it is.


tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] FTP - folders

2006-10-23 Thread tedd

At 2:56 PM -0700 10/23/06, Ed Lazor wrote:

On Oct 23, 2006, at 2:27 PM, Richard Lynch wrote:


On the Mac, I always dug Fetch personally.


Nice... I've been looking for something like Fetch.


Yeah, Fetch is super cool, but it's been around as long as I have -- 
I'm surprised you haven't heard of it before.


The name came about while we were trying to program with sticks 
(upgrade from rocks) and our dog kept running away with memory. 
Incidentally, the dog also demonstrated the first memory leak by 
raising his leg, but that's another story.


Sorry, too long at the keyboard today.  :-)

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] FTP - folders

2006-10-23 Thread Stut

tedd wrote:

Interesting.

So a php server-side php script can establish a two-way communication 
with a client-side php script -- do you have an example?


http://php.net/sockets

-Stut

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



Re: [PHP] FTP - folders

2006-10-23 Thread Richard Lynch
On Mon, October 23, 2006 5:07 pm, tedd wrote:
 Interesting.

 So a php server-side php script can establish a two-way communication
 with a client-side php script -- do you have an example?

http://php.net/sockets
should have an example...

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] FTP - folders

2006-10-23 Thread Rob Kritzer

Yes Tedd,

This is what I am having trouble with, I can see where you can upload each
file, but all I really need it to do is take the contents of a folder and
upload everything it finds in the directory.

Rob



On 10/23/06, tedd [EMAIL PROTECTED] wrote:


At 8:42 PM +0100 10/23/06, Stut wrote:
Rob Kritzer wrote:
Is it possible to FTP a folder and all it's content? I can do a file at
a
time, but not a folder.

Also there is times when I will not know the folder name, so I would
like it
to just upload everything it finds in the folder I set.

Is this possilbe?

Yes[1][2].

-Stut

[1] http://catb.org/~esr/faqs/smart-questions.html
[2] There is no function to upload a folder, but it's quite easy to
code. Check out http://php.net/glob and/or http://php.net/readdir

-Stut:

Perhaps I'm confused (certainly could be), but I think the OP is
asking for a way to upload multiple files from a desktop folder to a
server (client-side to sever-side) by just selecting the desktop
(client-side) folder.

Maybe I should read [1] a little closer, but I did read [2] and I
don't see where one can use php to open a folder on a desktop, read
its contents, and then upload the files therein. However, I do see a
way to upload individual files, but not multiple files _unless_ the
user selects them one at a time and then uploads them consecutively
via a loop. But, that still requires the user to select the files
individually and not the folder that contains them.

I certainly can read the contents of a folder on the server, but I
don't see how you can do it client-side.

Now, am I right, or do you have a way to do this?

Thanks.

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com



Re: [PHP] FTP

2006-10-09 Thread Chris

Stut wrote:

Raphael Martins wrote:

I will be sending files over my php script... One client asked me for a
project where he allow clients to send some large files (like 50mb)...I
thought that FTP (via PHP)  will allow that.

Today he just give the FTP server user and password to his clients, 
but he

is worried about the security (of course!). Is there a better way? I was
thinking in split the files in several .RAR volumes... (actually, the 
client
will send his .RAR files instead of a 50mb file), and use remote 
scripting

to upload each file separatly.


Eww, nasty.


Any Ideas?


Set the upload_max_filesize value for the directory where the upload 
script lives. That would be the cleanest way to allow this to happen.


However, HTTP was not designed for uploading files of that size so you 
are better off using an FTP server - this would almost certainly not 
involve PHP at all. If security is a concern you could generate a 
temporary FTP user from a PHP script that will get removed after, say, 
24 hours. How you would do this will vary depending on the FTP server 
you are using.


You could also set the ftp account up to be locked into a particular 
folder.. so if anyone got access to it, they would only see the .rar 
files and nothing else.


Easily done depending on which ftp server you are using but that's way 
out of scope for this mailing list.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] FTP

2006-10-09 Thread Richard Lynch
On Sat, October 7, 2006 6:50 pm, Raphael Martins wrote:
 When I send files via FTP, the file size is limited to the php.ini max
 upload value?

Yes.

:-)

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] FTP

2006-10-09 Thread Richard Lynch
Uploading huge files via HTTP is generally problematic.

Set up FTP usernames/passwords/directories for each of his clients is
probably the best answer.

On Sun, October 8, 2006 6:05 am, Raphael Martins wrote:
 I will be sending files over my php script... One client asked me for
 a
 project where he allow clients to send some large files (like
 50mb)...I
 thought that FTP (via PHP)  will allow that.

 Today he just give the FTP server user and password to his clients,
 but he
 is worried about the security (of course!). Is there a better way? I
 was
 thinking in split the files in several .RAR volumes... (actually, the
 client
 will send his .RAR files instead of a 50mb file), and use remote
 scripting
 to upload each file separatly.

 Any Ideas?

 Thank you!

 2006/10/8, Yannick Warnier [EMAIL PROTECTED]:

 Le samedi 07 octobre 2006 à 20:50 -0300, Raphael Martins a écrit :
  Hi,
 
  When I send files via FTP, the file size is limited to the php.ini
 max
  upload value?
  Thank you!

 No, unless you handle the FTP server with a PHP script. php.ini only
 limits the size of files handled by PHP (generally via HTTP), so it
 should not affect FTP (unless your FTP server is in PHP).

 Yannick

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





-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] FTP

2006-10-08 Thread Yannick Warnier
Le samedi 07 octobre 2006 à 20:50 -0300, Raphael Martins a écrit :
 Hi,
 
 When I send files via FTP, the file size is limited to the php.ini max
 upload value?
 Thank you!

No, unless you handle the FTP server with a PHP script. php.ini only
limits the size of files handled by PHP (generally via HTTP), so it
should not affect FTP (unless your FTP server is in PHP).

Yannick

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



Re: [PHP] FTP

2006-10-08 Thread Raphael Martins

I will be sending files over my php script... One client asked me for a
project where he allow clients to send some large files (like 50mb)...I
thought that FTP (via PHP)  will allow that.

Today he just give the FTP server user and password to his clients, but he
is worried about the security (of course!). Is there a better way? I was
thinking in split the files in several .RAR volumes... (actually, the client
will send his .RAR files instead of a 50mb file), and use remote scripting
to upload each file separatly.

Any Ideas?

Thank you!

2006/10/8, Yannick Warnier [EMAIL PROTECTED]:


Le samedi 07 octobre 2006 à 20:50 -0300, Raphael Martins a écrit :
 Hi,

 When I send files via FTP, the file size is limited to the php.ini max
 upload value?
 Thank you!

No, unless you handle the FTP server with a PHP script. php.ini only
limits the size of files handled by PHP (generally via HTTP), so it
should not affect FTP (unless your FTP server is in PHP).

Yannick

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




Re: [PHP] FTP

2006-10-08 Thread Yannick Warnier
Le dimanche 08 octobre 2006 à 08:05 -0300, Raphael Martins a écrit :
 I will be sending files over my php script... One client asked me for a
 project where he allow clients to send some large files (like 50mb)...I
 thought that FTP (via PHP)  will allow that.
 
 Today he just give the FTP server user and password to his clients, but he
 is worried about the security (of course!). Is there a better way? I was
 thinking in split the files in several .RAR volumes... (actually, the client
 will send his .RAR files instead of a 50mb file), and use remote scripting
 to upload each file separatly.
 
 Any Ideas?

There is a PECL SSH library which allows file transfers over SSH (using
PHP). I have received some reports that it's not completely stable
though, but I don't know more about it. You might want to contact Sara
Golemon (the packager) on the PECL-dev mailing list if you manage to get
into stability problems...
See http://pecl.php.net/package/ssh2 for more details.

Yannick

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



Re: [PHP] FTP

2006-10-08 Thread Stut

Raphael Martins wrote:

I will be sending files over my php script... One client asked me for a
project where he allow clients to send some large files (like 50mb)...I
thought that FTP (via PHP)  will allow that.

Today he just give the FTP server user and password to his clients, but he
is worried about the security (of course!). Is there a better way? I was
thinking in split the files in several .RAR volumes... (actually, the 
client

will send his .RAR files instead of a 50mb file), and use remote scripting
to upload each file separatly.


Eww, nasty.


Any Ideas?


Set the upload_max_filesize value for the directory where the upload 
script lives. That would be the cleanest way to allow this to happen.


However, HTTP was not designed for uploading files of that size so you 
are better off using an FTP server - this would almost certainly not 
involve PHP at all. If security is a concern you could generate a 
temporary FTP user from a PHP script that will get removed after, say, 
24 hours. How you would do this will vary depending on the FTP server 
you are using.


-Stut

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



[PHP] FTP

2006-10-07 Thread Raphael Martins

Hi,

When I send files via FTP, the file size is limited to the php.ini max
upload value?
Thank you!


Re: [PHP] FTP

2006-10-07 Thread Brad Chow

Hi Martins,

Of course. You can alter it you want.

I remember that file size limit devided into two type:
1) local access
2) remote access

file size limit only limit remote access because I can upload file from
local more than limit.

Good luck!!

Brad

On 10/8/06, Raphael Martins [EMAIL PROTECTED] wrote:


Hi,

When I send files via FTP, the file size is limited to the php.ini max
upload value?
Thank you!




[PHP] FTP

2006-10-06 Thread Raphael Martins

Hi,
I need to send large files over my website...I was wondering if I could do
this using the PHP FTP Commands. The files will be larger then the
MAX_UPLOAD_SIZE in php.ini.

Is that possible? Or should I use a regular FTP program?

Thank you!


Re: [PHP] FTP Copy

2006-09-22 Thread Richard Lynch
On Tue, September 19, 2006 8:14 pm, Chris wrote:
... FTP copy ...

Depending on the security issues, and SCP from exec() may be more
suitable...

Another option would be to upload a PHP script to one or the other
that does the FTP you want one way or the other... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] FTP Copy

2006-09-19 Thread Matt Palermo
I've been looking on php.net, but can't find anything that covers this... 
Basically, I am using PHP FTP to connect to an FTP server and run some 
functions.  I want to copy a directory on the FTP server to another 
directory on the FTP server.  Since there isn't an ftp_copy() function, I 
have to use ftp_get() to bring the file to the local webserver temp folder, 
then use ftp_put() to place it into a different folder on the FTP server. 
This is quite a big pain, since the webserver is not on the same network as 
the remote FTP server, so it must download the file and then upload it to a 
different place (takes a long time).  Is there an FTP that will just copy 
the file/folder from the FTP server without the need to download/upload it 
somewhere else?

Thanks,

Matt 

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



Re: [PHP] FTP Copy

2006-09-19 Thread Chris

Matt Palermo wrote:
I've been looking on php.net, but can't find anything that covers this... 
Basically, I am using PHP FTP to connect to an FTP server and run some 
functions.  I want to copy a directory on the FTP server to another 
directory on the FTP server.  Since there isn't an ftp_copy() function, I 
have to use ftp_get() to bring the file to the local webserver temp folder, 
then use ftp_put() to place it into a different folder on the FTP server. 
This is quite a big pain, since the webserver is not on the same network as 
the remote FTP server, so it must download the file and then upload it to a 
different place (takes a long time).  Is there an FTP that will just copy 
the file/folder from the FTP server without the need to download/upload it 
somewhere else?


You can't do this through ftp itself so I think you're out of luck.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] FTP - moving/copying files

2006-06-29 Thread James Nunnerley
I'm setting up an ftp manager which allows a user to connect to their space
on an external server.

 

All the php-ftp functions work fine - after I'd realized how to use the
passive functionality - see previous email to list!

 

I've also got working the download and upload functionality, which is quite
nice, but annoying - it doesn't allow you to download the file without
creating a temporary version (whereas if it were a local copy you'd be able
to copy it to a variable, then echo it out...

 

Finally, what I now need to do it be able to move/copy files within the FTP
space.  The standard FTP commands (mv  cp or copy) are not featured in
php-ftp functions.  Does anyone have any suggestions bar copying the whole
lot to a local drive then upload in the new space?

 

Cheers

Nunners



Re: [PHP] FTP - moving/copying files

2006-06-29 Thread Jochem Maas
James Nunnerley wrote:
 I'm setting up an ftp manager which allows a user to connect to their space
 on an external server.
 
  
 
 All the php-ftp functions work fine - after I'd realized how to use the
 passive functionality - see previous email to list!
 
  
 
 I've also got working the download and upload functionality, which is quite
 nice, but annoying - it doesn't allow you to download the file without
 creating a temporary version (whereas if it were a local copy you'd be able
 to copy it to a variable, then echo it out...
 
  
 
 Finally, what I now need to do it be able to move/copy files within the FTP
 space.  The standard FTP commands (mv  cp or copy) are not featured in
 php-ftp functions.  Does anyone have any suggestions bar copying the whole
 lot to a local drive then upload in the new space?

what about: http://php.net/manual/en/function.ftp-rename.php ?

 
  
 
 Cheers
 
 Nunners
 
 

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



[PHP] FTP Problems

2006-06-27 Thread James Nunnerley
I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo FTP connection has failed!;
echo Attempted to connect to $ftp_server for user $usernamebr /;
exit;

} else {

echo Connected to $ftp_server, for user $usernamebr /;

}

echo(ftp_pwd($conn_id).br /); # Comes back with /

$buff = ftp_nlist($conn_id,);

// close the FTP stream
ftp_close($conn_id); 

var_dump($buff); = comes back with bool(false)

exit;

Can anyone see what could be wrong?


Cheers

Nunners



Re: [PHP] FTP Problems

2006-06-27 Thread nicolas figaro

I had many troubles with ftp_nlist since I discovered the -a option.

try this :

$buff = ftp_nlist($conn_id,-a);


N F

James Nunnerley a écrit :

I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo FTP connection has failed!;
echo Attempted to connect to $ftp_server for user $usernamebr /;
exit;

} else {

echo Connected to $ftp_server, for user $usernamebr /;

}

echo(ftp_pwd($conn_id).br /); # Comes back with /

$buff = ftp_nlist($conn_id,);

// close the FTP stream
ftp_close($conn_id); 


var_dump($buff); = comes back with bool(false)

exit;

Can anyone see what could be wrong?


Cheers

Nunners


  



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

RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Nope - unfortunately, no change, still the same problems, logging in but no
ftp_nlist or indeed ftp_rawlist

Cheers
Nunners

-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:12
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

I had many troubles with ftp_nlist since I discovered the -a option.

try this :

$buff = ftp_nlist($conn_id,-a);


N F

James Nunnerley a écrit :
 I'm trying to create some functionality which requires FTPing onto another
 server, using the php functions.

 Doing the following comes up with a successful login, but cannot display
the
 current directory; yet when I FTP directory from the server which is
serving
 the php pages, it works fine.

 // set up basic connection
 $conn_id = ftp_connect($ftp_server, 21);
 ftp_pasv($conn_id, true);

 // login with username and password
 $login_result = ftp_login($conn_id, $username, $password);

 // check connection
 if ((!$conn_id) || (!$login_result)) {

 echo FTP connection has failed!;
 echo Attempted to connect to $ftp_server for user $usernamebr /;
 exit;

 } else {

 echo Connected to $ftp_server, for user $usernamebr /;

 }

 echo(ftp_pwd($conn_id).br /); # Comes back with /

 $buff = ftp_nlist($conn_id,);

 // close the FTP stream
 ftp_close($conn_id); 

 var_dump($buff); = comes back with bool(false)

 exit;

 Can anyone see what could be wrong?


 Cheers

 Nunners


   

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



Re: [PHP] FTP Problems

2006-06-27 Thread chris smith

On 6/27/06, James Nunnerley [EMAIL PROTECTED] wrote:

I'm trying to create some functionality which requires FTPing onto another
server, using the php functions.

Doing the following comes up with a successful login, but cannot display the
current directory; yet when I FTP directory from the server which is serving
the php pages, it works fine.

// set up basic connection
$conn_id = ftp_connect($ftp_server, 21);
ftp_pasv($conn_id, true);

// login with username and password
$login_result = ftp_login($conn_id, $username, $password);

// check connection
if ((!$conn_id) || (!$login_result)) {

echo FTP connection has failed!;
echo Attempted to connect to $ftp_server for user $usernamebr /;
exit;

} else {

echo Connected to $ftp_server, for user $usernamebr /;

}

echo(ftp_pwd($conn_id).br /); # Comes back with /

$buff = ftp_nlist($conn_id,);


ftp_nlist requires a directory name. A blank string is not a directory name.

http://au.php.net/ftp_nlist

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] FTP Problems

2006-06-27 Thread nicolas figaro

James Nunnerley a écrit :

Nope - unfortunately, no change, still the same problems, logging in but no
ftp_nlist or indeed ftp_rawlist

  

even with a pathname ?
ftp_nlist($conn_id, -a /)

do you have any log on the server ?
( you can also sniff the network to watch what php sends).

NF

Cheers
Nunners
  



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

RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Thanks for the reply Chris.

How would you suggest displaying the current home directory for the user?
I've tried / and indeed the real directory name on that particular server.

Funnily enough, I've also just tried a generic php/ftp script tool, and it
works on a third party server into the one I'm trying to connect to, but not
from the server I'm working on!

Is there anyway in which php needs configuring for certain connections?

-Original Message-
From: chris smith [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:16
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

On 6/27/06, James Nunnerley [EMAIL PROTECTED] wrote:
 I'm trying to create some functionality which requires FTPing onto another
 server, using the php functions.

 Doing the following comes up with a successful login, but cannot display
the
 current directory; yet when I FTP directory from the server which is
serving
 the php pages, it works fine.

 // set up basic connection
 $conn_id = ftp_connect($ftp_server, 21);
 ftp_pasv($conn_id, true);

 // login with username and password
 $login_result = ftp_login($conn_id, $username, $password);

 // check connection
 if ((!$conn_id) || (!$login_result)) {

 echo FTP connection has failed!;
 echo Attempted to connect to $ftp_server for user $usernamebr /;
 exit;

 } else {

 echo Connected to $ftp_server, for user $usernamebr /;

 }

 echo(ftp_pwd($conn_id).br /); # Comes back with /

 $buff = ftp_nlist($conn_id,);

ftp_nlist requires a directory name. A blank string is not a directory name.

http://au.php.net/ftp_nlist

-- 
Postgresql  php tutorials
http://www.designmagick.com/

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



RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Just tried that, and still the same result - I think it's the server - going
to ask the server admin now!

-Original Message-
From: nicolas figaro [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:19
To: PHP List
Subject: Re: [PHP] FTP Problems

James Nunnerley a écrit :
 Nope - unfortunately, no change, still the same problems, logging in but
no
 ftp_nlist or indeed ftp_rawlist

   
even with a pathname ?
ftp_nlist($conn_id, -a /)

do you have any log on the server ?
( you can also sniff the network to watch what php sends).

NF
 Cheers
 Nunners
   

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



Re: [PHP] FTP Problems

2006-06-27 Thread Jochem Maas
James Nunnerley wrote:
 Thanks for the reply Chris.
 
 How would you suggest displaying the current home directory for the user?
 I've tried / and indeed the real directory name on that particular server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is even 
allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server your
working with is a little borked (but that a gut feeling).


 
 Funnily enough, I've also just tried a generic php/ftp script tool, and it
 works on a third party server into the one I'm trying to connect to, but not
 from the server I'm working on!
 
 Is there anyway in which php needs configuring for certain connections?
 
 -Original Message-
 From: chris smith [mailto:[EMAIL PROTECTED] 
 Sent: 27 June 2006 14:16
 To: James Nunnerley
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] FTP Problems
 
 On 6/27/06, James Nunnerley [EMAIL PROTECTED] wrote:
 I'm trying to create some functionality which requires FTPing onto another
 server, using the php functions.

 Doing the following comes up with a successful login, but cannot display
 the
 current directory; yet when I FTP directory from the server which is
 serving
 the php pages, it works fine.

 // set up basic connection
 $conn_id = ftp_connect($ftp_server, 21);
 ftp_pasv($conn_id, true);

 // login with username and password
 $login_result = ftp_login($conn_id, $username, $password);

 // check connection
 if ((!$conn_id) || (!$login_result)) {

 echo FTP connection has failed!;
 echo Attempted to connect to $ftp_server for user $usernamebr /;
 exit;

 } else {

 echo Connected to $ftp_server, for user $usernamebr /;

 }

 echo(ftp_pwd($conn_id).br /); # Comes back with /

 $buff = ftp_nlist($conn_id,);
 
 ftp_nlist requires a directory name. A blank string is not a directory name.
 
 http://au.php.net/ftp_nlist
 

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



RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Thanks all - it would seem that php is failing to set the passive mode to
true - I can get around it temporarily, but need to find a more permanent
option.

Does anyone have any experience as to why setting ftp_pasv to true fails?

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:29
To: James Nunnerley
Cc: 'chris smith'; php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

James Nunnerley wrote:
 Thanks for the reply Chris.
 
 How would you suggest displaying the current home directory for the
user?
 I've tried / and indeed the real directory name on that particular
server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is
even allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server
your
working with is a little borked (but that a gut feeling).


 
 Funnily enough, I've also just tried a generic php/ftp script tool, and it
 works on a third party server into the one I'm trying to connect to, but
not
 from the server I'm working on!
 
 Is there anyway in which php needs configuring for certain connections?
 
 -Original Message-
 From: chris smith [mailto:[EMAIL PROTECTED] 
 Sent: 27 June 2006 14:16
 To: James Nunnerley
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] FTP Problems
 
 On 6/27/06, James Nunnerley [EMAIL PROTECTED] wrote:
 I'm trying to create some functionality which requires FTPing onto
another
 server, using the php functions.

 Doing the following comes up with a successful login, but cannot display
 the
 current directory; yet when I FTP directory from the server which is
 serving
 the php pages, it works fine.

 // set up basic connection
 $conn_id = ftp_connect($ftp_server, 21);
 ftp_pasv($conn_id, true);

 // login with username and password
 $login_result = ftp_login($conn_id, $username, $password);

 // check connection
 if ((!$conn_id) || (!$login_result)) {

 echo FTP connection has failed!;
 echo Attempted to connect to $ftp_server for user $usernamebr /;
 exit;

 } else {

 echo Connected to $ftp_server, for user $usernamebr /;

 }

 echo(ftp_pwd($conn_id).br /); # Comes back with /

 $buff = ftp_nlist($conn_id,);
 
 ftp_nlist requires a directory name. A blank string is not a directory
name.
 
 http://au.php.net/ftp_nlist
 

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

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



RE: [PHP] FTP Problems

2006-06-27 Thread James Nunnerley
Ah - whoops - just worked out why - you need to set the passive mode after
you login, not after a connect! Silly solution!

-Original Message-
From: James Nunnerley [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:37
To: 'Jochem Maas'
Cc: 'chris smith'; php-general@lists.php.net
Subject: RE: [PHP] FTP Problems

Thanks all - it would seem that php is failing to set the passive mode to
true - I can get around it temporarily, but need to find a more permanent
option.

Does anyone have any experience as to why setting ftp_pasv to true fails?

-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED] 
Sent: 27 June 2006 14:29
To: James Nunnerley
Cc: 'chris smith'; php-general@lists.php.net
Subject: Re: [PHP] FTP Problems

James Nunnerley wrote:
 Thanks for the reply Chris.
 
 How would you suggest displaying the current home directory for the
user?
 I've tried / and indeed the real directory name on that particular
server.

you could try '~/' (or maybe just'~') as the dir name which equates to the
'the current users homedir' when you in a shell - no idea whether that is
even allowable
when going in via ftp but might be worth a shot though - given what you have
been saying in your thread one would hazard to guess that the ftp server
your
working with is a little borked (but that a gut feeling).


 
 Funnily enough, I've also just tried a generic php/ftp script tool, and it
 works on a third party server into the one I'm trying to connect to, but
not
 from the server I'm working on!
 
 Is there anyway in which php needs configuring for certain connections?
 
 -Original Message-
 From: chris smith [mailto:[EMAIL PROTECTED] 
 Sent: 27 June 2006 14:16
 To: James Nunnerley
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] FTP Problems
 
 On 6/27/06, James Nunnerley [EMAIL PROTECTED] wrote:
 I'm trying to create some functionality which requires FTPing onto
another
 server, using the php functions.

 Doing the following comes up with a successful login, but cannot display
 the
 current directory; yet when I FTP directory from the server which is
 serving
 the php pages, it works fine.

 // set up basic connection
 $conn_id = ftp_connect($ftp_server, 21);
 ftp_pasv($conn_id, true);

 // login with username and password
 $login_result = ftp_login($conn_id, $username, $password);

 // check connection
 if ((!$conn_id) || (!$login_result)) {

 echo FTP connection has failed!;
 echo Attempted to connect to $ftp_server for user $usernamebr /;
 exit;

 } else {

 echo Connected to $ftp_server, for user $usernamebr /;

 }

 echo(ftp_pwd($conn_id).br /); # Comes back with /

 $buff = ftp_nlist($conn_id,);
 
 ftp_nlist requires a directory name. A blank string is not a directory
name.
 
 http://au.php.net/ftp_nlist
 

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

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

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



Re: [PHP] FTP Problems

2006-06-27 Thread Jochem Maas
James Nunnerley wrote:
 Ah - whoops - just worked out why - you need to set the passive mode after
 you login, not after a connect! Silly solution!

sharing the fix was anything but silly - :-)

 
 -Original Message-
 From: James Nunnerley [mailto:[EMAIL PROTECTED] 
 Sent: 27 June 2006 14:37
 To: 'Jochem Maas'
 Cc: 'chris smith'; php-general@lists.php.net
 Subject: RE: [PHP] FTP Problems
 
 Thanks all - it would seem that php is failing to set the passive mode to
 true - I can get around it temporarily, but need to find a more permanent
 option.
 
 Does anyone have any experience as to why setting ftp_pasv to true fails?
 

...

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



Re: [PHP] FTP Problems

2006-06-27 Thread Chris

James Nunnerley wrote:

Thanks for the reply Chris.

How would you suggest displaying the current home directory for the user?
I've tried / and indeed the real directory name on that particular server.

Funnily enough, I've also just tried a generic php/ftp script tool, and it
works on a third party server into the one I'm trying to connect to, but not
from the server I'm working on!

Is there anyway in which php needs configuring for certain connections?


Even though you have this fixed..

. means the current directory so you could:

ftp_nlist($connection, .);

to display this directory and go from there.

In this case:
ftp_nlist($connection, /);

Whether / means system level (ie so you'd see /proc, /etc and so on) 
or whether it takes you back to the base for that ftp account depends on 
the ftp server setup. Some lock you in to your /home type folder and 
some don't.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP] FTP

2005-09-22 Thread Gustav Wiberg

Hi all!

I took this code directly from PHP.net but I don't get it to work 
correctly...I've never worked with ftp-connections with PHP before...



?php

$ftp_server = ftp.example.com;
$ftp_user = foo;
$ftp_pass = bar;

// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die(Couldn't connect to 
$ftp_server);


// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  echo Connected as [EMAIL PROTECTED];
} else {
  echo Couldn't connect as $ftp_user\n;
}

// close the connection
ftp_close($conn_id);
?

It seems to work fine when I'm trying on my testmachiner (WIndows XP + 
Apache) , but when I put the file on the webserver at my webhost (b-one), 
then I just get a blank page and showing source-code like this:


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; 
charset=windows-1252/HEAD

BODY/BODY/HTML

What could be the problem?

/G
http://www.varupiraten.se/


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



Re: [PHP] FTP

2005-09-22 Thread John Nichel

Gustav Wiberg wrote:

Hi all!

I took this code directly from PHP.net but I don't get it to work 
correctly...I've never worked with ftp-connections with PHP before...



?php

$ftp_server = ftp.example.com;
$ftp_user = foo;
$ftp_pass = bar;

// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die(Couldn't connect to 
$ftp_server);


// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  echo Connected as [EMAIL PROTECTED];
} else {
  echo Couldn't connect as $ftp_user\n;
}

// close the connection
ftp_close($conn_id);
?

It seems to work fine when I'm trying on my testmachiner (WIndows XP + 
Apache) , but when I put the file on the webserver at my webhost 
(b-one), then I just get a blank page and showing source-code like this:


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; 
charset=windows-1252/HEAD

BODY/BODY/HTML

What could be the problem?


Is your web host running something other than Windows?  Does it have the 
ftp functions enabled?  Make a phpinfo page, and access that in your 
browser to see if the ftp functions are enabled.  You are more than 
likely not seeing the error on your host because they have error 
reporting turned off.  You can use ini_set to switch this if you want.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] FTP

2005-09-22 Thread Gustav Wiberg
- Original Message - 
From: John Nichel [EMAIL PROTECTED]

To: PHP Mailing Lists php-general@lists.php.net
Sent: Thursday, September 22, 2005 8:53 PM
Subject: Re: [PHP] FTP



Gustav Wiberg wrote:

Hi all!

I took this code directly from PHP.net but I don't get it to work 
correctly...I've never worked with ftp-connections with PHP before...



?php

$ftp_server = ftp.example.com;
$ftp_user = foo;
$ftp_pass = bar;

// set up a connection or die
$conn_id = ftp_connect($ftp_server) or die(Couldn't connect to 
$ftp_server);


// try to login
if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) {
  echo Connected as [EMAIL PROTECTED];
} else {
  echo Couldn't connect as $ftp_user\n;
}

// close the connection
ftp_close($conn_id);
?

It seems to work fine when I'm trying on my testmachiner (WIndows XP + 
Apache) , but when I put the file on the webserver at my webhost (b-one), 
then I just get a blank page and showing source-code like this:


!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=Content-Type content=text/html; 
charset=windows-1252/HEAD

BODY/BODY/HTML

What could be the problem?


Is your web host running something other than Windows?  Does it have the 
ftp functions enabled?  Make a phpinfo page, and access that in your 
browser to see if the ftp functions are enabled.  You are more than likely 
not seeing the error on your host because they have error reporting turned 
off.  You can use ini_set to switch this if you want.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.4/109 - Release Date: 2005-09-21



Hi again!

Yes, you're right...

I get this error now...

Fatal error: Call to undefined function: ftp_connect() in 
/customers/varupiraten.se/varupiraten.se/httpd.www/web/do_ftp.php on line 8


Isn't it enough to ftp to be a registred stream?

Here is the info of PHP...
http://www.varupiraten.se/web/phpinfo.php

/G
http://www.varupiraten.se/

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



Re: [PHP] FTP

2005-09-22 Thread John Nichel

Gustav Wiberg wrote:

Hi again!

Yes, you're right...

I get this error now...

Fatal error: Call to undefined function: ftp_connect() in 
/customers/varupiraten.se/varupiraten.se/httpd.www/web/do_ftp.php on line 8


Isn't it enough to ftp to be a registred stream?

Here is the info of PHP...
http://www.varupiraten.se/web/phpinfo.php


I don't think so.  According to the manual, it has to be 
configured/compiled in.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] FTP

2005-09-22 Thread Gustav Wiberg


- Original Message - 
From: John Nichel [EMAIL PROTECTED]

To: PHP Mailing Lists php-general@lists.php.net
Sent: Thursday, September 22, 2005 9:08 PM
Subject: Re: [PHP] FTP



Gustav Wiberg wrote:

Hi again!

Yes, you're right...

I get this error now...

Fatal error: Call to undefined function: ftp_connect() in 
/customers/varupiraten.se/varupiraten.se/httpd.www/web/do_ftp.php on line 
8


Isn't it enough to ftp to be a registred stream?

Here is the info of PHP...
http://www.varupiraten.se/web/phpinfo.php


I don't think so.  According to the manual, it has to be 
configured/compiled in.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.4/109 - Release Date: 2005-09-21



Hi

I thought that was the answer... *sigh*

Thanx! :-)

/G
http://www.varupiraten.se/

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



[PHP] FTP Chmod problem

2005-09-04 Thread Matt Palermo
Hello everyone.  I have a script where I am using FTP functions to chmod 
files/folders.  I'm running into a problem with the ftp_chmod() function 
when trying to change the permissions of a directory.  Here is the code I'm 
using:

ftp_chmod($connId, 0777, $folder);

The function almost works, but when I check the permission of the folder 
after it's run, the folder has 410 for permissions instead of 777.  So, it 
is changing the permissions, but not to the correct value.  Now when I use 
the following code, it seems to work fine:

$chmodCmd = CHMOD 0777 .$file;
ftp_site($connId, $chmodCmd);

This properly changes the folder permissions to 777.  Does anyone know why 
the ftp_chmod() function doesn't work correctly?  As a side note, the 
ftp_chmod() function works correctly on a file, but not a directory.  Any 
help is appreciated.

Thanks,

Matt Palermo
http://sweetphp.com 

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



[PHP] ftp problems

2005-08-03 Thread tripwater
Hello, I have a site that allows developers to upload current modules to 
the webserver. It has been requested that when this is done, I also ftp a 
backup copy to a remote server. Something is wrong here. The file upload 
code works. The back ftp code works,only  if I comment out the 
move_uploaded_file() function. I can not get them both to work. After the 
move_uploaded_file() function moves the file to the webserver, the 
ftp_put() fails, but if I comment out the move_uploaded_file(), the 
ftp_put() works. Can anyone help me with this? I have posted this on other 
forums and working on this for a couple of weeks now. 



1. I am uploading the module to the webserver. 
2. Then in the next step want to ftp same module to backup server. 

I tried posting my code but it got rejected by the server for security 
reasons...


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



RE: [PHP] ftp problems

2005-08-03 Thread Jay Blanchard
[snip]
Hello, I have a site that allows developers to upload current modules to

the webserver. It has been requested that when this is done, I also ftp
a 
backup copy to a remote server. Something is wrong here. The file upload

code works. The back ftp code works,only  if I comment out the 
move_uploaded_file() function. I can not get them both to work. After
the 
move_uploaded_file() function moves the file to the webserver, the 
ftp_put() fails, but if I comment out the move_uploaded_file(), the 
ftp_put() works. Can anyone help me with this? I have posted this on
other 
forums and working on this for a couple of weeks now. 
[snip]

And now you have posted it here twice within 30 minutes under different
headers.

[snip]
1. I am uploading the module to the webserver. 
2. Then in the next step want to ftp same module to backup server. 
[/snip]

Looks like a pretty good flowchart. move_uploaded_file() is part of the
upload process. Then you want to ftp the file from where you moved it to
with your ftp process. move_uploaded_file() is not part of ftp

[snip]
I tried posting my code but it got rejected by the server for security 
reasons...
[/snip]

Cut and paste your code into the e-mail, attachments to lists aren't
generally welcomed.

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



RE: [PHP] ftp problems

2005-08-03 Thread Jay Blanchard
[snip]
What is top-post? and also, how can I show you my code is I can not send
it
in the email? DO I need to attach it?
[/snip]


Top posting is posting your reply above the message. It makes the
subject read out of order.

Because it is backwards.
Why?
Top posting is bad.

Cut and paste your code into the e-mail. Only cut and paste the relevant
section of code.

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



Re: [PHP] ftp upload via web form - problem getting the file name correct

2005-03-08 Thread Franklin van de Meent
Hello Steve,

I tried this on my own servers and after replacing OUR FTP SERVER
with $ftp_server it works perfectly, all ASCII files get uploaded the
way they should with the correct filenames.

Do you get any errors? (add error_reporting(E_ALL); above the login
vars to show them all)

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



Re: [PHP] ftp upload via web form - problem getting the file name correct

2005-03-08 Thread Steve Turnbull
Franklin van de Meent wrote:

 Hello Steve,
 
 I tried this on my own servers and after replacing OUR FTP SERVER
 with $ftp_server it works perfectly, all ASCII files get uploaded the
 way they should with the correct filenames.
 
 Do you get any errors? (add error_reporting(E_ALL); above the login
 vars to show them all)
Hi
I got a direct email reply yesterday which didn't show up on this list.
Basically I needed to replace

if (ftp_put($c, $ftp_server, $tmp_file, FTP_ASCII)){

with

if (ftp_put($c, $_FILES['ftp_f']['name'], $tmp_file, FTP_ASCII)){

and it worked.

The OUR FTP SERVER was just a suggested meaning for the url which is
actually in there.

Thanks for the help

Steve

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



[PHP] FTP functions

2005-03-07 Thread Vaibhav Sibal
Hi
I checked ou the ftp functions of PHP, what I wanted to ask was that
if I connect to a remote server and issue and ftp_fget() command the
file will be downloaded to the server running the PHP code and Apache
webserver or the client machine from which we are calling it ? In the
sense for example I have a client machine running on windows XP, I
launch the mozilla firefox browser in that and call for the
ftp_code.php on my server (http://server). The ftp_code.php contains a
code which connects to a remote ftp server and then using the
ftp_fget() function downloads a file from the remote server. Now where
will this file be downloaded ?

Though I have an inkling that since PHP is a server side scripting
language, the file will be downloaded to the server only... But i
still wanted to confirm

Please confirm

Thanks in advance

Vaibhav Sibal

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



Re: [PHP] FTP functions

2005-03-07 Thread Tim Boring
Hello!

On Mon, 2005-03-07 at 18:20 +0530, Vaibhav Sibal wrote:
 Hi
 I checked ou the ftp functions of PHP, what I wanted to ask was that
 if I connect to a remote server and issue and ftp_fget() command the
 file will be downloaded to the server running the PHP code and Apache
 webserver or the client machine from which we are calling it ? In the
 sense for example I have a client machine running on windows XP, I
 launch the mozilla firefox browser in that and call for the
 ftp_code.php on my server (http://server). The ftp_code.php contains a
 code which connects to a remote ftp server and then using the
 ftp_fget() function downloads a file from the remote server. Now where
 will this file be downloaded ?

The short answer is it would download it to the server, not the client
on which Firefox is running.  But if you were wanting to transfer the
file to the client, I'd think you could do something creative like this:

1. Have your script download the file from the remote server.
2. Once the file has been downloaded, display a new page to the browser
with a link to the file.
3. Then the user can click the link to retrieve/open the file.

Now this may not be the best solution, it just happens to be what I
could think of off the top of my head.  There may be better ways to
accomplish the same thing.

Hope that helps!

Tim

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



[PHP] ftp upload via web form - problem getting the file name correct

2005-03-07 Thread Steve Turnbull
Hi

I have tried creating a script which will allow our core staff to upload
files to our FTP server.

I don't have a problem with the uploading of a local file to our FTP server
with the correct authentication etc, the problem I am having, is that the
file which gets uploaded always has the filename of 'www.ourdomain.net'
which is the destination web server name.

I have a form, which has a file 'browse' element. PHP stores the local file
in /tmp/ as with a temporary file name (I can see this with
$_FILES['$file']['tmp_name']), but I don't know why it gets converted to
'www.ourdomain.net' in the final stages?

My code (rough, but you get the idea);

Thanks for any help
Steve

?php

$ftp_server = 'OUR FTP SERVER';
$un = $_REQUEST['ftp_un'];
$pw = $_REQUEST['ftp_pw'];
$tmp_file   = $_FILES['ftp_f']['tmp_name'];
$file   = $_FILES['ftp_f']['name'];
?

html
head
titleFTP Interface/title
/head

body

div id=topHeader
h1FTP Interface/h1/td
/div

?php

if (is_null($file)) {
?

div
You need a username  password to upload files to the FTP area.br /br /

form enctype=multipart/form-data action=?php echo $_SERVER
['PHP_SELF'] ? method=post

div
spanUsername: /span
span style=position:absolute; left:150px;input type=text
name=ftp_un //span
/div

div
spanPassword: /span
span style=position:absolute; left:150px;input type=password
name=ftp_pw //span
/div

div
spanBrowse for file: /span
input type=hidden name=MAX_FILE_SIZE value=10 /
span style=position:absolute; left:150px;input type=file
name=ftp_f //span
/div

div
input type=submit value=Upload File Now /
/div

/form
/div

?php
}
else {



$c = ftp_connect($ftp_server, 21)   or die(Can't connect);


if (!ftp_login($c, $un, $pw)){
echo 'Login details incorrect, please try again...';
} else {
if (ftp_put($c, $ftp_server, $tmp_file, FTP_ASCII)){
ftp_rename($c, OUR FTP SERVER, $file) or die(ftp rename didn't
work);
echo 'your file has transfered successfully!';
} else {
echo 'There was a problem, please retry...';
}
}


ftp_close($c);

}

?

body

/html

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



[PHP] FTP info in a variable

2005-02-25 Thread Steve Buehler
	I have to write a little program that pulls information from a database, 
formats it into csv format for importing into excel and ftps it to another 
server.  I have everything worked out except for the ftping.  I have read 
through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the 
data from the database, save it to a file and ftp it.  Does anybody know if 
I can skip the step of saving it to a file and ftp/stream it directly to a 
filename on another server?

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


[PHP] FTP info in a variable

2005-02-25 Thread Steve Buehler
original message
	I have to write a little program that pulls information from a database, 
formats it into csv format for importing into excel and ftps it to another 
server.  I have everything worked out except for the ftping.  I have read 
through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the 
data from the database, save it to a file and ftp it.  Does anybody know if 
I can skip the step of saving it to a file and ftp/stream it directly to a 
filename on another server?
end of original message

Ok.  Looking for something else, I was reminded that fopen is what I 
needed.  Since I am uploading a file every night with the same file 
name.  I had to use the ftp options to delete the old file first since I 
cant use:
$handle = fopen(ftp://user:[EMAIL PROTECTED]/somefile.txt, w);
It won't allow for truncating the file to zero length.

My message original message has still not be sent back to me from the 
list.  Hopefully this one will get through and everybody will see that I 
have solved the problem.  I will read other responses if I ever get anymore 
mail from the list :) .  Maybe one of the responses will work even better 
for me.

Thanks
Steve 

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


Re: [PHP] FTP info in a variable

2005-02-25 Thread Richard Lynch
The list has definitely been quite funky last night and today...

Steve Buehler wrote:
 original message
   I have to write a little program that pulls information from a database,
 formats it into csv format for importing into excel and ftps it to another
 server.  I have everything worked out except for the ftping.  I have read
 through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the
 data from the database, save it to a file and ftp it.  Does anybody know
 if
 I can skip the step of saving it to a file and ftp/stream it directly to a
 filename on another server?

You might be able to do something with named pipes and/or exec and
redirect and a little helper PHP script that takes STDIN as an open stream
and passes that to http://php.net/ftp_fput

I think you'd get better performance and a lot less headache just using a
tmp file, though.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] FTP info in a variable

2005-02-25 Thread Steve Buehler
At 11:07 AM 2/25/2005, you wrote:
Steve Buehler wrote:
   I have to write a little program that pulls information from a 
database,
 formats it into csv format for importing into excel and ftps it to another
 server.  I have everything worked out except for the ftping.  I have read
 through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the
 data from the database, save it to a file and ftp it.  Does anybody know
 if
 I can skip the step of saving it to a file and ftp/stream it directly to a
 filename on another server?

What you just described is pretty much the entire PURPOSE of
http://php.net/manual/en/ref.ftp.php
Now that you know that, re-read that, and you'll realize just how easy
this is gonna be. :-)
PS You may find it easier to go ahead and use a local temporary file, just
to use fputcsv() instead of rolling your own.  Or not, as rolling your own
CSV writer isn't exactly rocket science.
Maybe I missed it the second time through, but I still can't find anything 
that makes that the entire PURPOSE of what you referred too.  Like I 
said, I might have missed it though, that one is for ftping a file.  What I 
was hoping for is to NOT have to create the file locally first before 
uploading it.  Right after sending this email, I was looking for something 
else and found out that fopen is what I was looking for.  I still have to 
use the ref.ftp.php ftp functions to delete the file on the remote server 
first though because fopen can not open an existing file on a remote 
server, zero it out and then write to it and it can't just delete a 
remote file.that I know of.  So I have to delete it first with the ftp 
functions, then ftp it over from the variable into a remote file.  At least 
I don't have to create a temporary file on the local server first.  That is 
what I was really trying to avoid.

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


Re: [PHP] FTP info in a variable

2005-02-25 Thread Richard Lynch
Steve Buehler wrote:
   I have to write a little program that pulls information from a database,
 formats it into csv format for importing into excel and ftps it to another
 server.  I have everything worked out except for the ftping.  I have read
 through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the
 data from the database, save it to a file and ftp it.  Does anybody know
 if
 I can skip the step of saving it to a file and ftp/stream it directly to a
 filename on another server?

What you just described is pretty much the entire PURPOSE of
http://php.net/manual/en/ref.ftp.php

Now that you know that, re-read that, and you'll realize just how easy
this is gonna be. :-)

PS You may find it easier to go ahead and use a local temporary file, just
to use fputcsv() instead of rolling your own.  Or not, as rolling your own
CSV writer isn't exactly rocket science.

-- 

Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] FTP info in a variable

2005-02-25 Thread Tyler Replogle
Yes i think you can but i really won't do that. It does depend on the server 
and php verison that is installed on the server.

From: Steve Buehler [EMAIL PROTECTED]
To: PHP php-general@lists.php.net
Subject: [PHP] FTP info in a variable
Date: Thu, 24 Feb 2005 11:19:25 -0600
MIME-Version: 1.0
Received: from lists.php.net ([216.92.131.4]) by MC8-F29.hotmail.com with 
Microsoft SMTPSVC(6.0.3790.211); Fri, 25 Feb 2005 08:56:50 -0800
Received: from ([216.92.131.4:22676] helo=lists.php.net)by pb1.pair.com 
(ecelerity HEAD r(5124)) with SMTPid 39/05-51537-DC85F124 for 
[EMAIL PROTECTED]; Fri, 25 Feb 2005 11:56:46 -0500
Received: (qmail 50993 invoked by uid 1010); 25 Feb 2005 16:21:52 -
Received: (qmail 20808 invoked by uid 1010); 25 Feb 2005 15:49:59 -
X-Message-Info: 6sSXyD95QpUypKMHi+vQyQhgpFDWBX43dtyZ3S9x9rA=
Return-Path: [EMAIL PROTECTED]
X-Host-Fingerprint: 216.92.131.4 lists.php.net  Mailing-List: contact 
[EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: mailto:[EMAIL PROTECTED]
list-unsubscribe: mailto:[EMAIL PROTECTED]
list-post: mailto:php-general@lists.php.net
Delivered-To: mailing list php-general@lists.php.net
Delivered-To: [EMAIL PROTECTED]
Delivered-To: [EMAIL PROTECTED]
X-Host-Fingerprint: 66.163.170.83 smtp813.mail.sc5.yahoo.com  X-Mailer: 
QUALCOMM Windows Eudora Version 6.2.1.2
X-OriginalArrivalTime: 25 Feb 2005 16:56:50.0514 (UTC) 
FILETIME=[FFF46320:01C51B5A]

	I have to write a little program that pulls information from a database, 
formats it into csv format for importing into excel and ftps it to another 
server.  I have everything worked out except for the ftping.  I have read 
through http://us4.php.net/manual/en/ref.ftp.php and I know I can get the 
data from the database, save it to a file and ftp it.  Does anybody know if 
I can skip the step of saving it to a file and ftp/stream it directly to a 
filename on another server?

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


RE: [PHP] FTP script and project

2005-02-09 Thread Jay Blanchard
[snip]
I'm in need of some fully functional stand-alone php FTP scripts, I've 
searched the web, have downloaded a couple but they don't work.

While this looks valid and appears to be uploading the file, no file is 
ever saved other than a temporary file that vanishes as soon as the 
file has completed uploading.
[/snip]

Have you RTFM? http://us2.php.net/manual/en/features.file-upload.php
contains an example or two and explains that the temp file disappears
and that you should use
http://us2.php.net/manual/en/function.move-uploaded-file.php

Sorry you don't have time to figure it out.

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



[PHP] FTP script and project

2005-02-08 Thread D . Walsh
I'm in need of some fully functional stand-alone php FTP scripts, I've 
searched the web, have downloaded a couple but they don't work.

While this looks valid and appears to be uploading the file, no file is 
ever saved other than a temporary file that vanishes as soon as the 
file has completed uploading.

HTML
HEAD
TITLEUpload test /TITLE
/HEAD
BODY
HR
FORM METHOD=POST  ENCTYPE=multipart/form-data 
action=upload_done.html
P
Select File 1: INPUT TYPE=file ID=file VALUE=br
PINPUT TYPE=submit
/FORM
/BODY
/HTML

_
Seems that everyone has their own implementation of how it should be 
done so I'd like to obtain some working examples that I don't have to 
spend time figuring out why it doesn't work just for test purposes.

If you have something, please send it to me, a variety of choices for 
test purposes would be ideal.

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


Re: [PHP] FTP script and project

2005-02-08 Thread Jason Wong
On Wednesday 09 February 2005 12:58, D.Walsh wrote:
 I'm in need of some fully functional stand-alone php FTP scripts, I've
 searched the web, have downloaded a couple but they don't work.

 While this looks valid and appears to be uploading the file, no file is
 ever saved other than a temporary file that vanishes as soon as the
 file has completed uploading.

[HTTP upload code snipped]

It seems that you're confused as to what FTP is and what HTTP is. Perhaps 
if you explained what you are trying to do then someone might be able to 
point you in the right direction.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



  1   2   3   >