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




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 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 UPLOAD

2002-12-16 Thread Marios Adamantopoulos
Hi all 
I have a problm uploading a simple file to my server using the PHP FTP
functions.
I would appreciate it if anyone could help:

The HTML part:

form enctype=multipart/form-data action=ftp.php method=post
name=FormName
Upload file : 
input type=file name=thefile size=24 border=0
input type=hidden name=phpftp_dir value =? echo $phpftp_dir?
size=24 border=0
input type=submit name=submitButtonName value=Upload border=0
/form

The PHP:
(which gives me the error: (Warning: error opening
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in
/home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line
with the ftp_put() function)


$picture = thefile_name;
$picture1 = $$picture;
$theimage = $picture1;

$source_file =
C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\ . $theimage;

$destination_file = /var/www/html/ftp/ . $theimage;

$upload = ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY); 


// check upload status
if (!$upload) { 
echo brFTP upload has failed!;
} else {
echo brUploaded $source_file to $ftpServer as
$destination_file;
}

_
Marios Adamantopoulos
Senior Developer

Tonic
+44 (0)20 7691 2227
+44 (0)7970 428 372
www.tonic.co.uk

Recent projects
www.polydor.co.uk
www.adcecreative.org
www.sony-europe.com/pocketlife


Opinions, conclusions and other information in this message that do not
relate to the official business of Tonic Design Limited shall be
understood as neither given nor endorsed by them.




-Original Message-
From: Chris Hewitt [mailto:[EMAIL PROTECTED]] 
Sent: 16 December 2002 11:54
To: Miguel González Castaños; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Mail() Not working right


Miguel González Castaños wrote:

I am testing the php mail function with the typical script

$mailsuccess = mail(...);
if (!$mailsuccess) {
echo Mail could not be sent;
}

In one redhat linux box I got that the email was sent succesfully and 
in the other box, it cant send it, but the script is executed (no parse 
errors).

I have sendmail 8.11-2 and php 4.1.2.

As i have said in my other email, I have checked if I have set properly 
the nobody privileges to execute sendmail and set the smtp and 
sendmail_path variables in the php.ini.

Do you know how I could figure out what is going on? Any way of 
debugging or testing?

What does the mail log say? Its usually /var/log/maillog. You say that 
the email is not sent, but what error message do you get? I think we 
need to know a little more about the error.

HTH
Chris




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



Re: [PHP] FTP UPLOAD

2002-12-16 Thread Andrew Brampton
Well I think the error is telling you whats up
The file
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt
Doesn't exist

Try changing the line to something like this:
$source_file = $HTTP_POST_FILES['thefile']['tmp_name'];

This or
$source_file = $_FILES['userfile']['tmp_name'];
(if you are using the more lastest PHP version)

Hope this helps

Andrew
- Original Message -
From: Marios Adamantopoulos [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 16, 2002 12:11 PM
Subject: [PHP] FTP UPLOAD


Hi all
I have a problm uploading a simple file to my server using the PHP FTP
functions.
I would appreciate it if anyone could help:

The HTML part:

form enctype=multipart/form-data action=ftp.php method=post
name=FormName
Upload file :
input type=file name=thefile size=24 border=0
input type=hidden name=phpftp_dir value =? echo $phpftp_dir?
size=24 border=0
input type=submit name=submitButtonName value=Upload border=0
/form

The PHP:
(which gives me the error: (Warning: error opening
C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in
/home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line
with the ftp_put() function)


$picture = thefile_name;
$picture1 = $$picture;
$theimage = $picture1;

$source_file =
C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\ . $theimage;

$destination_file = /var/www/html/ftp/ . $theimage;

$upload = ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY);


// check upload status
if (!$upload) {
echo brFTP upload has failed!;
} else {
echo brUploaded $source_file to $ftpServer as
$destination_file;
}

_
Marios Adamantopoulos
Senior Developer

Tonic
+44 (0)20 7691 2227
+44 (0)7970 428 372
www.tonic.co.uk

Recent projects
www.polydor.co.uk
www.adcecreative.org
www.sony-europe.com/pocketlife


Opinions, conclusions and other information in this message that do not
relate to the official business of Tonic Design Limited shall be
understood as neither given nor endorsed by them.




-Original Message-
From: Chris Hewitt [mailto:[EMAIL PROTECTED]]
Sent: 16 December 2002 11:54
To: Miguel González Castaños; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Mail() Not working right


Miguel González Castaños wrote:

I am testing the php mail function with the typical script

$mailsuccess = mail(...);
if (!$mailsuccess) {
echo Mail could not be sent;
}

In one redhat linux box I got that the email was sent succesfully and
in the other box, it cant send it, but the script is executed (no parse
errors).

I have sendmail 8.11-2 and php 4.1.2.

As i have said in my other email, I have checked if I have set properly
the nobody privileges to execute sendmail and set the smtp and
sendmail_path variables in the php.ini.

Do you know how I could figure out what is going on? Any way of
debugging or testing?

What does the mail log say? Its usually /var/log/maillog. You say that
the email is not sent, but what error message do you get? I think we
need to know a little more about the error.

HTH
Chris




--
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 upload

2002-04-05 Thread ubomr Zvodsk

Hello
,is it possible to upload file that is bigger than 8MB thrue FTP upload
programmed in PHP? I need send attachments up to 50MB by FTP. It's for a
graphic studio which works with big files.
If yes how?
Thank you 
Zavodsky
[EMAIL PROTECTED]


---
Odchoz zprva neobsahuje viry.
Zkontrolovno antivirovm systmem AVG (http://www.grisoft.cz).
Verze: 6.0.338 / Virov bze: 189 - datum vydn: 14.3.2002
 


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