[PHP-DEV] PHP 4.0 Bug #8461 Updated: ftp_put() some files will be sent, some files won't

2001-03-09 Thread sniper

ID: 8461
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Closed
Bug Type: FTP related
Assigned To: 
Comments:

no feedback.


Previous Comments:
---

[2001-01-24 04:05:38] [EMAIL PROTECTED]
Possible reasons:

1. The script timeouts. 
Solution: set_time_limit(0)

2. There is a file with same name as the target and it
has read-only permissions.

3. The local file is not readable by the user with which
the web server is running.

--Jani


---

[2000-12-28 12:12:14] [EMAIL PROTECTED]
the target is, to send all files in a specific directory to an ftp-account.
PHP-Version 4.04
Server IIs (windows NT)


the source:

//## start code ###
if($fazftpport){
$fazftpid   = ftp_connect($fazftphost, $fazftpport);   
 // -- works !!
} else {
$fazftpid   = ftp_connect($fazftphost);
// -- works !!
}
if(!ftp_login($fazftpid, $fazftpuser, $fazftppwd)){
 // -- works !!
die("Fehler beim LogIn (FTP-Server: " . $fazftphost . ")");
} else {
 if(!ftp_chdir($fazftpid, $fazftpdir)){
   // -- works !!
die("ChangeDirectory nicht erfolgreich (" . $fazftpdir . ")");
} else {
print "FTP-Zugang geöffnet und Verzeichnis gewechseltbr";
}
$filecount = 1;
$fopendir = opendir($fazausgabepfad);   // Verzeichnisbaum lesen
if($fopendir = 0){
print "Start-Verzeichnis konnte nicht geöffnet werdenbr";
} else {
print "Start-Verzeichnis geöffnetbr";
while($filezwischen = readdir($fopendir)){
if($filezwischen != "."  $filezwischen != ".."){
print "Startdatei : " . $filezwischen . " / ";
$zieldatei = $filezwischen;
print "Zieldatei : " . $zieldatei . "br";

// Here is the problem !!!
// all files are .htm-files, so ascii is ok

if(ftp_put($fazftpid, $zieldatei, $filezwischen, 
FTP_ASCII)){   

// some files will be sent !
// but most files won't
// all files are set to the same permissions

print "Datei " . $filezwischen .  " 
erfolgreich übertragenbr";
} else {
print "Fehler ! Datei " . $filezwischen .  " konnte nicht 
übertragen werdenbr";
}
}
}

}

}
if(!ftp_quit($fazftpid)){ // -- works !!
die("Fehler beim Schließen des FTP-Connects (FTP-Server: " . $fazftphost . " / 
FTP-ID: " . $fazftpid . ")");
}
print "FTP-Zugang geschlossenbr";
// ### end code ###

comment:
all variables are given and OK.
some files will be sent, some files won't.
we did not figure out, why files are not sent, becouse, when i copy a sendable file 
and try it again, the new file will not be sent.




---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8461edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8461 Updated: ftp_put() some files will be sent, some files won't

2001-01-24 Thread sniper

ID: 8461
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: FTP related
Assigned To: 
Comments:

Possible reasons:

1. The script timeouts. 
Solution: set_time_limit(0)

2. There is a file with same name as the target and it
has read-only permissions.

3. The local file is not readable by the user with which
the web server is running.

--Jani


Previous Comments:
---

[2000-12-28 12:12:14] [EMAIL PROTECTED]
the target is, to send all files in a specific directory to an ftp-account.
PHP-Version 4.04
Server IIs (windows NT)


the source:

//## start code ###
if($fazftpport){
$fazftpid   = ftp_connect($fazftphost, $fazftpport);   
 // -- works !!
} else {
$fazftpid   = ftp_connect($fazftphost);
// -- works !!
}
if(!ftp_login($fazftpid, $fazftpuser, $fazftppwd)){
 // -- works !!
die("Fehler beim LogIn (FTP-Server: " . $fazftphost . ")");
} else {
 if(!ftp_chdir($fazftpid, $fazftpdir)){
   // -- works !!
die("ChangeDirectory nicht erfolgreich (" . $fazftpdir . ")");
} else {
print "FTP-Zugang geöffnet und Verzeichnis gewechseltbr";
}
$filecount = 1;
$fopendir = opendir($fazausgabepfad);   // Verzeichnisbaum lesen
if($fopendir = 0){
print "Start-Verzeichnis konnte nicht geöffnet werdenbr";
} else {
print "Start-Verzeichnis geöffnetbr";
while($filezwischen = readdir($fopendir)){
if($filezwischen != "."  $filezwischen != ".."){
print "Startdatei : " . $filezwischen . " / ";
$zieldatei = $filezwischen;
print "Zieldatei : " . $zieldatei . "br";

// Here is the problem !!!
// all files are .htm-files, so ascii is ok

if(ftp_put($fazftpid, $zieldatei, $filezwischen, 
FTP_ASCII)){   

// some files will be sent !
// but most files won't
// all files are set to the same permissions

print "Datei " . $filezwischen .  " 
erfolgreich übertragenbr";
} else {
print "Fehler ! Datei " . $filezwischen .  " konnte nicht 
übertragen werdenbr";
}
}
}

}

}
if(!ftp_quit($fazftpid)){ // -- works !!
die("Fehler beim Schließen des FTP-Connects (FTP-Server: " . $fazftphost . " / 
FTP-ID: " . $fazftpid . ")");
}
print "FTP-Zugang geschlossenbr";
// ### end code ###

comment:
all variables are given and OK.
some files will be sent, some files won't.
we did not figure out, why files are not sent, becouse, when i copy a sendable file 
and try it again, the new file will not be sent.




---


Full Bug description available at: http://bugs.php.net/?id=8461


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]